To understand design pattern, the best way is to practice many examples.
- Separation of concerns
- Keep related data and behaviour together
- Information hiding
- Cohesion good, coupling bad
- Program to the interface, not the implementation
- Encapsulate that which varies
- Hide your decisions
- Make stable abstractions
- Make your system open for extension but closed for modification
- Do not over-engineer your solution
- If it can change, it ain't inheritance
- Favour composition over inheritance
- Inheritance isn't dynamic
- Inheritance for implementation
- Is a role of
- Becomes
- Over-specialisation
- Violating the LSP
- Changing the super class contract
- S: Single responsibility
- O: Open-closed principle
- L: Liskov substitution principle
- I: Interface segregation principle
- D: Dependency inversion
- Preconditions
- Postconditions
- Invariant
- Singleton
- Factory
- Observer
- Composite
- Decorator
- Template
- Command
-
Coursera Desig pattern