programs on design patterns
- Factory Method : separate a simple logic required for creation of object into a factory method
- Abstract Factory : factory of factories
- Builder : prevent constructor pollution
- Prototype :
- Singleton : make one and only one object
- Adapter : make two incompatible interfaces compatible
- Bridge :
- Composite :
- Decorator : decorate the object without going suffering the class explosion
- Facade : hide complex sub-system and provide the outer interface to the client
- Flyweight :
- Proxy : rather than providing original class/implementation to the client, provide a proxy class which adds some additional/necessary features to the original class.
- Chain of Responsibility :
- Command :
- Iterator : iterate through all the elements without knowing the interal implementation
- Mediator :
- Memento :
- Observer : like subject notifying all its observers whenever its state changes
- Visitor :
- Strategy : make your strategy at run time and pass the required object
- State :
- Template Method :