In object-oriented programming (OOP), design patterns are useful organizations of state and behavior that make your code more readable, testable, and extensible. Now that you understand classes, inheritance, objects, and the basics of programming, let’s go over some common design patterns—common ways of arranging application code.
Observer
The observer pattern allows you to broadcast information from one class to many others, without them having to know about each other directly (low coupling).
It is often used with events. For example, the KeyListener, MouseListener, and many other “Listener” ...