Classification of design patterns and KISS principle
October 9, 2012 1 Comment
Classification based on creation/structure/behavior.
Creational Patterns provide us a way to decouple the client from the objects that it needs to instantiate.
- Singleton
- Factory
- Abstract factory
- Prototype
- Builder
Structural patterns help us to compose classes or objects into larger structures
- Composite
- Decorator
- Facade
- Proxy
- Adapter
- Bridge
- Flyweight
Behavioral Patterns dictates how classes and objects interact with each other and distribute the responsibilities
- Template Method
- Strategy
- Observer
- Command
- Iterator
- Chain of responsibility
- Visitor, Mediator and Interpretor
- State
Secondary classification based on classes and objects.
Class patterns describe how relationships between classes is defined via inheritance and these relationships are established at compile time
- Template Method
- Factory Method
- Adapter
- Interpretor
Object patterns describe relationships between objects via composition and these relationships are created at runtime which is more dynamic and flexible
- Singleton
- Abstract Factory
- Composite
- Decorator
- Command
- Observer
- Strategy
- … all others go here
It doesnt matter how any patterns we know, always make sure to keep the code simple. KISS PRINCIPLE keep it simple stupid principle
thanks