- Notifications
You must be signed in to change notification settings - Fork 0
Observer design pattern
Devrath edited this page Dec 2, 2023 · 7 revisions

- Assume there is a data source that we can call an
observableand there are many clients who areobserverslistening for the change in the data of theobservable. When there is a change inobservable` all the observers are notified. - Now we need The
data sourceto talk to all theobserverswithout being tightly coupled. - We can use an interface called
observerand makedata sourceto talk to theinterface. - This preserves the
open-closed principlemeaning a functionality is open for extension and closed for modification. - There is a push and pull style approach. We are using the pull style approach in our case since it the best approach.
.