design pattern homework