Tuesday, October 16, 2012

Creational Design Pattern

There are three basic classifications of patterns Creational, Structural, and Behavioral patterns.

Creational Patterns

Abstract Factory:- Creates an instance of several families of classes
Builder: - Separates object construction from its representation
Factory Method:- Creates an instance of several derived classes.
Prototype:- A fully initialized instance to be copied or cloned
Singleton:- A class in which only a single instance can exist
Note: - The best way to remember Creational pattern is by remembering ABFPS (Abraham Became First President of States).

  • Factory:



if we add new concrete invoice type we do not need to change any thing at the client side.

 

  • Abstract Factory :






  • Builder

Builder pattern is useful when the construction of the object is very complex.

 


  • Prototype:

Clone the existing object with its data. By cloning any changes to the cloned object does not affect the original object value.



No comments:

Post a Comment