A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Monday, September 17, 2012

JAVA DESIGN PATTERNS - Creational Patterns

12:41:00 PM Posted by Satish Kumar No comments

All the creational patterns define the best possible way in which an object can be instantiated. Now everyone knows the object instance in Java can be created using a new operator.

Book book = new Book ();

So, what’s the great stuff? Well, that’s true. The new Operator creates the instance of an object, but this is hard-coding. 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.

There are five types of Creational Patterns.
1. Factory Pattern
2. Abstract Factory Pattern
3. Builder Pattern
4. Prototype Pattern
5. Singleton Pattern

I'll be explaining each in detail.


Post a Comment