Creational Pattern

The Creational pattern involves the construction of new objects. It often hides the constructors in the classes being created, and provides alternate methods to return instances of the desired class. It is used to change the class that is instantiated to fit the situation. Class creational patterns use inheritance to vary the object being created. Object creational patterns delegate the actual construction to a different object that is responsible for deciding which class is required and invoking the necessary constructor.

Since the subclass names are not hard coded into the program, additional subclasses that handle additional protocols can be added at later times without even recompiling any code. Creational design patterns can also be used to increase the flexibility about who creates an object, how the client creates the object, and when the object is created.

The common creational patterns are
(1) Abstract Factory - Defines an interface for creating instances of several related abstract classes without specifying their concrete subclasses.
(2) Builder - Builds different complex objects from the same set of component parts.
(3) Prototype - Creates new objects by copying a prototype object. By changing the object that is copied, one can change the object that is created.

What is a Design Pattern?
Creational Design Pattern
Structural Design Pattern
Behavioral Design Pattern
Why use Design Patterns?
Want to learn more?

About Us | Contact Us | Disclaimer | Privacy Policy | ©2008 thewebguru.com