A design pattern is a general repeatable/reusable solution to a commonly occurring problem with a given context in software design. It can be treated as a description or template for how to solve a problem that can be used in many different situations.
Mainly divided into 3 parts
- Singleton
- Factory Method/Factory
- Abstract Factory
- Builder
- Prototype
- Adapter
- Bridge
- Composite
- Decorator
- Flyweight
- Proxy
- Facade
- Chain of Responsibility
- Command
- Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
- Singletone Design Pattern
- Create default private constructor
- Create public static getInstance method which will return class instance
- Two ways to create 1 . Lazy Initialization 2 . Eager Initialization