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.
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.
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.
Template Method pattern is used to implement a process where subclasses can change some steps of the parent. This article demonstrates Template Method pattern implementations in Java.
Here we are discussing the implementation of Server-Server Events(SSE) using Python, specifically using the Flask framework. We are discussing 2 ways to implement SSE in Flask-Using Flask Features (without any extra package) and using Flask-SSE package.
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.
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.
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.
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.
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.
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.