David - Object Oriented Design PDF
David - Object Oriented Design PDF
A class changes for only one reason And then write tests
Favor multiple single-purpose interfaces Generalize Type One class implements behavior that is
over composite abstractly defined in another class.
Type-Checking ⇒ State/Strategy
Example: An Animal may Move(), but a Duck
Dependency Inversion Principle Conditional ⇒ Polymorphism
would move by waddling
Concrete classes depend on abstractions, Extract Method
not vice-versa
Extract Class Class Associations: Dependency
Builder Creational
Prototype Creational
Singleton Creational
Adapter Structural
Bridge Structural
Composite Structural
Decorator Structural
Facade Structural
Flyweight Structural
Proxy Structural
Command Behavioral
Interpreter Behavioral
Iterator Behavioral
Mediator Behavioral
Memento Behavioral
Observer Behavioral
State Behavioral
Strategy Behavioral
Visitor Behavioral