August 10, 2009
Design pattern often referred to as the Gang-Of-Four (because of the four authors who wrote it)
What is Design pattern?
A Design Pattern is a solution, which provides the solution to commonly occurring problems in software design. The Design Pattern is applied directly into code.
Object-oriented design patterns typically show relationships and interactions between classes or objects.
Algorithms and Patterns are different. Algorithms solve computational problems but design patterns deal specifically with problems at the level of software design.
Patterns are differs from Framework. A framework provides actual code. You use patterns in a framework to create the code.
Patterns are classified by their purpose and scope
1. Creational – related to object creation
2. Structural – concerning about structures created by class and
1. Behavior – which deals the common communication between
1. Class representation: uses class inheritance.
2. Object representation: uses object composition.
Creational design pattern
Creational design patterns are design patterns that deal with object creation.
Some examples of creational design patterns include:
ￂﾧ Abstract factory pattern
ￂﾧ Factory method pattern
ￂﾧ Builder pattern
ￂﾧ Lazy initialization pattern
ￂﾧ Object pool
ￂﾧ Prototype pattern
ￂﾧ Singleton pattern
Structural Design Patterns
Structural Design Patterns are Design Patterns that concerning about structures created by class and objects
Examples of Structural Patterns include:
ￂﾧ Adapter pattern
ￂﾧ Aggregate pattern
ￂﾧ Bridge pattern
ￂﾧ Composite pattern
ￂﾧ Decorator pattern
ￂﾧ Extensibility pattern
ￂﾧ Facade pattern
ￂﾧ Flyweight pattern
ￂﾧ Proxy pattern
ￂﾧ Pipes and filters
ￂﾧ Private class data pattern
Behavioral design patterns
Behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns
Examples of this type of design pattern include:
ￂﾧ Chain of responsibility pattern
ￂﾧ Command pattern
ￂﾧ Interpreter pattern
ￂﾧ Iterator pattern
ￂﾧ Mediator pattern
ￂﾧ Memento pattern
ￂﾧ Null Object pattern
ￂﾧ Observer pattern
ￂﾧ State pattern
ￂﾧ Strategy pattern
ￂﾧ Specification pattern
ￂﾧ Template method pattern
ￂﾧ Visitor pattern
ￂﾧ Single-serving visitor pattern
ￂﾧ Hierarchical visitor pattern
ￂﾧ data structure