Skip to main content

Posts

Showing posts with the label memento

Behavioral Patterns : Memento

Properties: -            Can be used when object state needs to be saved between interactions. Implementation: -            Originator class is the class of which state needs to be saved. It should be able to save its state into Memento objects and restore its state from Memento objects. -            Memento objects keep state of originator object. -            Caretaker is the client code which saves and restores state of originator using Memento objects. Java Standard Library Implementations: -            javax.faces.component.   StateHolder implementations -            java.sql.Connection Example Usage: try {     //assume connection is acq...