Observer Design Pattern used whenever a subject changes has to be observed by one or more observers.
Example domain usages: Stocks, Weather reports, News providers and Score providers, etc.
loosely coupling: Change of a state in one object must be reflected in another object without keeping the objects tight coupled.
Key problems:
- Many Observers to Many Observables.
- We can have either push or pull method data transfers.
- When many Onververs and Observables comes we may need to introuduce new logic object responsible(ChangeManager)
- Encapsulate the logic of notify the observers
- Maintain the many to many relations
- Receive the notifications from subjects and delegate them to the observers
Factory, Mediator and Template pattern can be used with in this design patterns.
No comments:
Post a Comment