« Back to Design Patterns in Object-Oriented Programming
USING DESIGN PATTERNS
Contents:
Key reference: DPG4
How design patterns solve design problems
- Identifying the appropriate objects for the purpose
- Determining object granularity
- Specifying object interfaces
- Specifying object implementations
NOTE: An object’s implementation is defined by its class
- Using reuse mechanisms
- Class inheritance
- Object composition
- Relating run-time and compile-time structures
- Object aggregation
- Object acquaintance
- Making the design adaptible to change
Reference: DGP4 (p. 41-68)
How to select a design pattern
- Consider how design patterns solve design problems
- Scan the “intent” sections
- Study how patterns interrelate
- Study patterns of similar purposes
- Examine cause of redesign (see DPG4, p. 61)
- Consider what should be variable in your design
- This is the opposite of examining cause of redesign
- Consider what you want to be able to change without redesign
Reference: DPG4 (p. 68-69)