Big Chemical Encyclopedia

Chemical substances, components, reactions, process design ...

Articles Figures Tables About

Memento Pattern

The Memento Pattern Without violating encapsulation, capture and externalize an object s state so that the object can be restored to this state later. [Pg.85]

Suppose the compound state transition only involves structure changes and undo only needs to recover the structure and the compound state. Figure 12.6 is the class diagram of the Memento Pattern for the Compound object. [Pg.85]

Figure 12.6 The class diagram of the Memento Pattern for the Compound object. Figure 12.6 The class diagram of the Memento Pattern for the Compound object.
Figure 12.7 is a sequence diagram that shows undo and redo using Memento Pattern. [Pg.90]

The above design using The State Pattern addresses a simple one-way traffic scenario of the flow—the process can only go forward, not backward. In reality, the chemist may want to undo and roll back a step either because of human mistakes or the system did something that is against the chemist s intention. Undo is a common functionality in many productivity software systems, such as Microsoft Word. Fortunately, there is another GoF design pattern called Memento, which provides an elegant solution. [Pg.85]


See other pages where Memento Pattern is mentioned: [Pg.90]    [Pg.90]   
See also in sourсe #XX -- [ Pg.85 , Pg.86 , Pg.87 , Pg.88 , Pg.89 ]




SEARCH



Memento

© 2024 chempedia.info