A design pattern is a general and reusable idea for recurring design problems; it is not readily coded solution, but rather provides proven templates and best practices for how to solve a specific problem and can be used recurrently. Design patterns are practical implementations that adhere to SOLID Design Principles and GRASP Design Principles. The sub-nodes of design pattern involves UML Diagrams for illustrating concepts.
Composition of a pattern node
- Pattern name
- e.g. Creational Patterns - Factory Method Pattern
- Applicability
- What the pattern is designed to solve (i.e. when to apply the pattern)
- Approach
- The process of how to apply and implement the pattern
- Components
- The components of the pattern to achieve its purpose
- Example
- A concrete example to demonstrate the concepts of a pattern
Classification of patterns base on purpose
- Creational Patterns
- Abstract the instantiation process
- Make a system independent of how its objects are created, composed and represented
- Structural Patterns
- How classes and objects are composed to form larger structures, while keeping the structures flexible and efficient
- Behavioural Patterns
- Concerns of algorithms and the assignment of responsibilities between objects
Classification of patterns based on relationships
- Patterns often used together
- e.g. Composite often used with Iterator or Visitor
- Alternative patterns
- e.g. Prototype often alternative to Abstract Factory
- Patterns results in similar design
- e.g. structure diagram of composite and Decorator are similar
- e.g. structure diagram of composite and Decorator are similar
Selecting an appropriate design pattern
- Consider the way in which the design patterns solve problems
- Decide on what the intent of each design is
- Look at the relationships among patterns
- Consider patterns with similar purpose
- Avoid future redesign
- Choose design that will not lock you into a particular one
Design aspects can varied by design patterns
Back to parent page: Web and Application Development
Design_Pattern Behavioural_Design_Patterns Structural_Design_Patterns Creational_Design_Patterns SOFT2201