- Allows tap on different object with different calculation for score.
- Allows to choose different payment options.
- Icecream shop
- add new type of ice creams with the help of decorator.
- Hamburger Store
- Remove conditions to get different kind of burgers
- suppose if we have 200 types of burgers - then we will have 200 conditions :(
- thats where Factory patterns comes in
- sometimes we do not need too many instances of a class
- singleton helps us create only one instance
- Game controller example
- Helps in connecting two different things (interfaces)
- provides a unified interface to a set of interfaces in the sub system.
- defines the skeleton of an algo in a method, referring some steps for subclass
- provides a way to access the element of an aggregate object sequentially
without exposing its underlying representation.
- Allows an object to alter its behavior when its internal state changes