Design patterns homework