CREATIONAL DESIGN PATTERNS
Design patterns are mostly “evolved” rather than “discovered”. None of these patterns force you anything in regard to implementation; they are just guidelines to solve a particular problem , in a particular way ,in particular contexts. Code implementation is developers responsibility.
Their are different ways that an object can be created.The most commonly know way of creating an object is using the new keyword.
Book book = new Book ();
The new Operator creates the instance of an object, but this is hard-coding.
While coding, hard coding is the last thing one should do. Also, at times the very nature of the object which is created can change according to the nature of the program. In such scenarios, we can make use of patterns to give this a more general and flexible approach.
Types of Creational Design Patterns
|1) Factory Pattern|
|2) Abstract Factory Pattern|
|3) Builder Pattern|
|4) Prototype Pattern|
|5) Singleton Pattern|
STRUCTURAL DESIGN PATTERNS
Structural design patterns are concerned with how classes and objects can be composed, to form larger structures.They simplifies the structure by identifying the relationships.
|Types of Structural Design Patterns|
BEHAVIOURAL DESIGN PATTERNS
Behavioral patterns are those which are concerned with interactions between the objects. The interactions between the objects should be such that they are talking to each other and still are loosely coupled. The loose coupling is the key to n-tier architectures. In this, the implementation and the client should be loosely coupled in order to avoid hard-coding and dependencies
|Types of Behavioural Design Patterns|
|Chain of Responsibility Pattern|
|Template Method Pattern|