A pattern is a reusable solution that can be applied to commonly occurring problems in software design. Design patterns have three main benefits as in the following.
- Provide solid approaches to solving issues in software development using proven techniques.
- Usually reflects an out of box solution that can be adapted to suit our needs
- Helps with expressing larger solutions elegantly
Design Patterns can be categorized in to three main categories as in the following.
Creational Patterns – Based on the concept of creating an object
o Abstract Factory
Creates an instance of several families of classes
o Factory Method
Creates an instance of several derived classes
A fully initialized instance to be copied or cloned
A class of which only a single instance can exist
Structural Patterns – Based on the idea of building blocks of objects
Match interfaces of different classes
Separates an object’s interface from its implementation
A tree structure of simple and composite objects
Behavioral Patterns – Based on the way object play and work together
Defines simplified communication between classes
A way of notifying change to a number of classes
o Template Method
Defer the exact steps of an algorithm to a subclass