What are design patterns
What are design patterns
If you remember the movie, the force “shapes and controls the Universe.”
Only when a solution balances both sides of the force (the light side: your goal, and the
dark side: the constraints) do we have a useful pattern.
Scrutinizing the definition
The car key example does seem to match the Design Pattern
definition, but it isn’t a true pattern.
Why?
Scrutinizing the definition
Because a pattern needs to apply to a recurring
problem.
We need to be able to give it to someone so they
can apply it to their unique situation.
It doesn’t have a name!
Scrutinizing the definition
Why?!
If there is a recurring bad solution to a common problem,
then by documenting it we can prevent other developers
from making the same mistake.
Anti-Patterns
Elements of an anti-pattern
An anti-pattern tells you why a bad solution is attractive.
An anti-pattern tells you why that solution in the long term is
bad.
An anti-pattern suggests other patterns that are applicable
which may provide good solutions.
List of Design Patterns
Strategy Pattern
Observer Pattern
Decorator Pattern
Factory Method
Abstract Factory Pattern
Singleton Pattern
Command Pattern
Adapter Pattern
Facade Pattern
Template Method Pattern