Design Patterns In Java – Observer By Example

In this design patterns in java series, I will be documenting the most common design patterns as written by the Gang of Four in their classic book: Design Patterns – Elements of Reusable Object-oriented Software.

I will maintain a pattern (no pun intended) of giving a real-world example then show you the code example. Ready? Let us do this!

design patterns java

Real World Example

Design patterns are everywhere in our lives. For example, a newspaper publishing company releases papers each morning and the papers are delivered to their customers/readers by the good old paper boys! So, the company will keep a list of newspaper subscribers in their database somewhere! The readers are free to subscribe to or unsubscribe from the service if you are tired or when money runs out! Makes sense right?