- What is memento design pattern used for?
- Which design pattern is used to create a slight difference in the output of the inherited classes?
- What is the difference between state and Strategy pattern?
What is memento design pattern used for?
Memento pattern is used to restore state of an object to a previous state. As your application is progressing, you may want to save checkpoints in your application and restore back to those checkpoints later. originator : the object for which the state is to be saved.
Which design pattern is used to create a slight difference in the output of the inherited classes?
Creational patterns make design become more flexible. They provide different ways to remove explicit references in the concrete classes from the code that needs to instantiate them. In other words, they create independency for objects and classes.
What is the difference between state and Strategy pattern?
State encapsulate state of an Object. While Strategy Pattern encapsulates an algorithm or strategy. State pattern helps a class to exhibit different behaviors in a different state.