Observer Pattern, Strategy Pattern, Visitor Pattern
It enables one or more objects to observe the states of one or more other objects. By implementing this pattern, one object request other object to intimate it for any change in a specific state which enables the system to refresh or act dynamically based on any state change anywhere in the system.
Here the object which is producing the events for state change is called observable and the object capturing the events is called observer.
- If an object contains the data for system and two different objects like JList and JTable are responsible to display this data in required format. Here JList and JTable can register themselves as observer to object containing the data. So that any change in data can be captured and corresponding change can be made in view.