Design Patterns give you a shared vocabulary with other developers. Once you’ve got the vocabulary you can more easily
communicate with other developers and inspire those who don’t know patterns to start learning them.
It also elevates your thinking about architectures by letting you think at the pattern level, not the nitty gritty
object level.
Patterns, like all forms of complexity, should be avoided until they are absolutely necessary.
-------------------------------------------------------------------------------------------------
Favour composition over inheritanceEncapsulate what variesProgram to interfaces, not implementation-------------------------------------------------------------------------------------------------
Loosely coupled principle allows us to build flexible OO systems that can handle change because they minimize the interdependency between objects.-------------------------------------------------------------------------------------------------
The Open-Closed Principle says Classes should be open for extension, but closed for modification.-------------------------------------------------------------------------------------------------
Dependency inversion principle says depend upon abstractions not on concrete classes i.e: reducing dependencies to concrete classes in our code is a “good thing-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
The principle of least knowledge says that talk to your immediate friends-------------------------------------------------------------------------------------------------
The hollywood principle states, don't calls us, we'll call you-------------------------------------------------------------------------------------------------
Single responsibilty principle asks a class to have only one reason to change-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
Facade pattern makes interfaces simplerDecorator pattern adds responsibility to existing classAdapter converts one interface to anotherThe factory method is a specialisation of the template methodStrategy pattern encapsulates interchangeable behaviour and uses delegation to choose oneIterator pattern provides a way to traverse collections without exposing internal implementationComposite pattern helps client treat collection of objects and objects uniformlyObserver pattern allows a group of objects to be notified when some state changesState pattern encapsulates state-based behaviour and delegates behaviour to the current state-------------------------------------------------------------------------------------------------
Head First Design Patterns-------------------------------------------------------------------------------------------------