Design Patterns homework Composite