In this recitation, you will revisit three crucial design patterns: Proxy, Composite, and Decorator. For each pattern, your task is to articulate key aspects, discuss why they are beneficial or problematic, and demonstrate their use in UML diagram in the context of Santorini's God Cards.
- Fill out the Proxy pattern template and answer follow-up questions of the TA
- Fill out the Composite pattern template and answer follow-up questions of the TA
- Fill out the Decorator pattern template and answer follow-up questions of the TA
Throughout the semester, we've delved into many commonly used design patterns, including Proxy, Composite, Decorator, Strategy, Template, Observer, and Adapter.
In this lab, we will focus on the first three.
For each design pattern, you are expected to provide information in five sections:
- Description: Define the key characteristics that distinguish the pattern from others.
- Pros: Why should you use this pattern? What specific problems does it solve and what design principles does it support?
- Cons: Why might you want to avoid this pattern? What design challenges or complications could it introduce?
- UML Diagram: Draw a UML object model for the pattern.
- Example: Reflect on your past programming experiences where this pattern could have improved your solution. If you can't think of a personal example, describe a scenario where using this pattern would have made the solution worse.
Create a copy of the template at https://docs.google.com/document/d/1zJSYX04pmMAP3MSmFljY9FSApkbeCS1v6Wyzt0ZbWfA/edit?usp=sharing
- Strive to devise your explanations before consulting external sources.
- While you are only required to explain three design patterns to the TA, feel free to continue filling in the information for the remaining patterns and seek clarification or assistance from the TA if needed.