| Start |
|---|
| Observer pattern The observer pattern is a common pattern, which is widely used in many contexts. A real example can be taken from YouTube: When you like a channel and want to get all news and watch new videos from this channel, you have to subscribe to that channel. Then, whenever this channel publishes any news, you (and all other subscribers) will receive a notification. An observer will have two components. One is a broadcaster (channel) and the other is a receiver (you or any other subscriber). The broadcaster will handle all receiver instances that subscribed to it. When the broadcaster fires a new event, it will announce this to all receiver instances. When the receiver receives an event, it will have to react to that event, for example, by turning on YouTube and playing the new video. Implementing the observer pattern |
| Singleton Class Example Java Singleton Pattern To implement Singleton pattern, we have different approaches but all of them have following common concepts.
|
Read Article
https://develop.horje.com/learn/1434/reference