Design Pattern in Java
Before going further first look at why we actually need design patterns. so if we have to solve the problem with a bunch of developers, they actually use their own coding patterns because there is no restriction. But what if we have a common vocabulary set to solve that particular problem. which might have easy to communicate with different developers with that common vocabulary set. That is where the design pattern came in play. Particular design pattern (such as singleton) tell the developer that you need to solve this problem using this particular coding pattern, so every developer can understand what is behind the scene and what is the strategy of it.
Alright then, now you know why we need design patterns. So let’s look at what are the design pattern groups
- Creational
- Structural
- Behavioural
So in this article, I mainly focus on the Creational design pattern group, This design pattern focuses on how objects are created. It is more than about replacing the new keyword when talking about creational design pattern.
So in the creational design pattern group, I cover the gang of four design patterns. Which are
The next article I will explain about singleton design pattern.