Patterns
Design patterns tell us how to structure classes and objects to solve certain problems
It is common for libraries and frameworks to make use of design patterns in their implementation.
Built around the key OO concepts: abstraction, inheritance, polymorphism, encapsulation
Encapsulate what varies or changes
Have composition over inheritance
Program to interfaces not implementations
Classes should be open for extension but closed for modification.
Patterns show you how to build systems with good OO design qualities
compound pattern ??
Pattern Categories
Creational | Object | Factory |
Involve object instantiation with a way of decouplying a client from the objects it needs to instantiate | Object | Builder |
Object | Prototype | |
Object | Singleton | |
Behavioural | Object | Chain of Responsibility |
How classes and object interact and distribute responsibility | Object | Command |
Class | Interpreter | |
Object | Iterator | |
Object | Mediator | |
Object | Memento | |
Object | Observer | |
Object | State | |
Object | Strategy | |
Class | Template Method | |
Object | Visitor | |
Structural | Class | Adapter |
Let you compose classes or objects into larger structures | Object | Bridge |
Object | Composite | |
Object | Decorator | |
Object | Facade | |
Object | Flyweight | |
Object | Proxy |
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopNext