Design Pattern: Visitor Pattern

Visitor pattern moves the operation or calculation part from the element/subject classes to a completely separate class. That separate class is called the visitor. As the operation/calculation is moved to the visitor class, so if we want to change the operation then we can just change the visitor class. No change in the subject classes is required in that case.

Design Pattern: Visitor Pattern in Java

Visitor pattern is used to move the operation/calculation part from a group of classes to a completely separate(Visitor) class. This article demonstrates Visitor pattern implementations in Java.

Design Pattern: Template Method Pattern

Template method pattern when we want the subclasses to define some steps of the processing steps (or algorithm). The parent class can define some steps and subclasses can some(which are required). Functionalities/steps which are completely different for subclasses are left to the subclasses for definition. The parent (abstract) class works are a skeleton here.

Design Pattern: State Pattern

In State pattern, an object (context object) changes its behavior when a certain internal state is changed. On state change the context object will change its behavior completely- like for performing a certain operation the context object will use different objects when the state is changed. This state change is managed internally so the client which is using the context object might not be aware of the state change.

Design Pattern: State Pattern in Java

State pattern is used to change the behavior of an object when the state is changed. With the change in state, the behavior of that object is completely changed. This article demonstrates State pattern implementations in Java.

Design Pattern: Observer Pattern

Observer pattern deals with state change between related objects. When one object depends on any state of another object, then when the state changes the dependent object needs to be notified. Observer pattern enables the dependent objects to subscribe to the state change of the subject object.

Design Pattern: Observer Pattern in Java

Observer pattern is used to automatically notify state change in object to all its dependent objects. It works as a pub/sub for state change between objects. This article demonstrates Observer pattern implementations in Java.

Design Pattern: Memento Pattern

Memento pattern is responsible for maintaining the history of state change of an object. By keeping the history, Memento pattern ensures that we can check the object state history at any point, and also can revert any state change and move to the previous state.

Design Pattern: Memento Pattern in Java

Memento pattern is used to store the history of state changes of an object so that that history can be used to track back the change or be used for some other purpose. This article demonstrates Memento pattern implementations in Java.