13 November 2009

Creational Design Patterns

Creational Design Patterns abstracts the instantiation of the objects. A simple question may occur to you: Why can't I just create a new Object using the new keyword and be happy thereafter. The answer is Yes, you can create an object. But you need to ask a couple of important design questions before conclusively saying Yes.
  1. Is my design flexible?
  2. Will my design promote re-usability? 
More often than not, instantiating an object with a new keyword would not result in a good design. We need to see how we can design a system that is both flexible and that promotes reusability. There are totally five creational design patterns which we will see in details one by one. They are,
  1. Abstract Factory
  2. Builder
  3. Prototype
  4. Factory Method
  5. Singleton
More on each of them in the following posts.