Sample Code for Design Patterns
Provides solution for the better interaction between objects and how to provide loose coupling and flexibility to extend easily. Achieves by Methods and their signatures.
- Chain of Responsibilities
- Iterator
- Observer
- Strategy
- Visitor
Provides solution to instantiate an object in the best possible way for specific situations. Achieves by Polymorphism.
- Abstract Factory
- Builder
- Factory
- Prototype
- Singleton (9 flavors)
Provides different ways to create a class structure, for example using inheritance and composition to create a large object from small objects. Achieves by Inheritance.
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Proxy
- Object Builder Design Pattern (Too Many Parameters)