300 likes | 410 Views
In software design, the abundance of patterns can overwhelm programmers. Mastering over 50 design patterns can be daunting, as most are variations of GRASP (General Responsibility Assignment Software Patterns) principles. This chapter emphasizes the importance of grasping the underlying themes rather than fixating on specific implementations. It introduces key concepts like Protected Variation, which addresses object instability by implementing stable interfaces to shield other program elements. Embrace the themes for a clearer understanding of software design instead of drowning in numerous patterns.
E N D
Pattern Overload: • Problem is there are hundreds of patterns. • Good programmer needs 50+ patterns • Most design patterns are specializations of GRASP principles • Focus on the underlying themes and not a specific pattern implementation of these themes.
Fig. 26.3 generalization is “suggestive” of the conceptual connections
GRASP Principles: • Protected Variation: • Problem: keep object instability from impacting other program elements. • Solution: Wrap points of instability with a stable interface. • Example: Writing your own adapter to hide direct calls to the API of some software package.