If you are a software developer, I believe that you have ever heard about design patterns. Design patterns represent the best practices used by experienced object-oriented software developers. In this repository, I will write all design patterns which are categorized into 3 types: Creational, Structural and Behavioral. The choice of programming language is not important, but in this project, I am using Java. Hope you like this!
Creational patterns:
- Factory: Create concrete products.
- FactoryMethod: Define an interface for creating objects, but let subclasses to decide which class to instantiate.
- AbstractFactory: Create abstract products.
- Singleton: Singleton can create only one instance.
Behavioural patterns:
- Observer: Observer pattern is used when there is one-to-many relationship between objects such as if one object is modified, its dependent objects are to be notified automatically.
- Chain of responsibility: Create a series of request handlers. Based on the content of request and condition, the request will be handled or passed to next request handler.