Thursday, August 13, 2009

Quick Byte Series - Creational Patterns

We starting a series of Quick Byte sessions where in we will try to get a quick grab of things we already know or atleast are supposed to know. In this first post, Lets get a quick view of Creational Patterns (the ones where in we are more concerned about object creation) :

Singleton : Provides single instance of the class, which is accessible throught out the application. We need to ensure that this is thread safe.

Factory Method : Provides an abstraction and let subclasses decide which class needs to be instantiated based on the provided parameters.

Abstract Factory Method : Layer above the Factory menthod. While in Factory method, we are covering for single object – here in Abstract Factory Method, we cater for multiple products.

Builder : Builder Pattern is used for creating a complex object from simple objects in a step-by-step process.

Prototype : When object creation comes with a cost, Prototype pattern comes to the rescue where in objects are cloned.

No comments:

Post a Comment