Design Patterns in Java : Creational

Share

How would you describe a design pattern? Why design patterns are important? 
These questions have been frequently being asked in technical sessions while hiring Programmers. Design Patterns can act as means of communicating a problem to another developer. You may already know how to solve a particular problem and it might follow the structure of a pattern, but it’s better to have a common vocabulary that you can explain to someone what that problem is.

Patterns are an abstract topic. It isn’t something that you look at the concept and then have it memorized and know how to apply it from there. Some patterns are more easily applied to particular problems than another, so I suggest revisiting patterns. Once you gain more experience in programming , your perception might change after coding those patterns. A lot of people have used a singleton and think that they have used design patterns, but there is much more than just a singleton out there.

Patterns – Classifications

The GoF (Gang of Four) has classified patterns into three groups:

CREATIONAL || STRUCTURAL ||  BEHAVIORAL

This discussion will focus completely on creational pattern. It is focused on how objects are created. There is lot more than just replacing the keyword new though, when talking about creational pattern.

Which Patterns ?

The creational patterns that we are going to cover are :

  • Singleton Pattern
  • Builder Pattnern
  • Prototype Pattern
  • Factory Pattern
  • AbstractFactory Pattern

We shall implement all of these patterns and compare and contrast them to one another and describe when the best case to use each individual one is.

 

 

About Dhiraj 40 Articles
Blogger on development, securities, and efficiency on web technologies.

Be the first to comment

Leave a Reply