Big Chemical Encyclopedia

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

Articles Figures Tables About

GoF Design Patterns

Many object-oriented patterns are codified and published by experienced object experts and thought leaders. The most well-known ones are the GoF design patterns (Gamma et al., 1995), Martin Fowler s analysis patterns... [Pg.21]

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]

Now assume you want to use the Vendor A solution. But the Vendor A API is different from MolfileSmilesConverter—the names of the methods may be different, parameter sets might be different, and the exceptions might be different too. How do you stick to your API on which the rest of your system is already dependent while leveraging a third-party solution The GoF Design Patterns book offers an elegant solution the Adapter (Gamma et al., 1995). [Pg.95]

This design uses another GoF Design Pattern—the Command Pattern. [Pg.133]

The state transition analysis leads to an important design decision—the GoF State Pattern (Gamma et al., 1995). [Pg.76]

A compound library contains one to many compound samples. In other words, library and compound sample form a Has-A relationship. At the same time, library and compound samples also share some common attributes such as project, chemist, and notebook. Therefore, they should have a common base class—we call it ChemicalEntity. In Figure 12.14, abstract class ChemicalEntity owns properties that are common to ChemicalLibrary and Chemicals ample, such as chemist, project, creation date, and notebook. Both ChemicalLibrary and ChemicalSample classes extend ChemicalEntity. The association line from ChemicalLibrary to ChemicalEntity indicates that a ChemicalLibrary is a composite of other chemical entities. This design is described as the Composite Pattern in the GoF book (Gamma et al., 1995). The benefit of the Composite Pattern is that component and composite share the same interfaces and therefore their clients can invoke them transparently without knowing whether they are dealing with a component or a composite at run time. [Pg.103]


See other pages where GoF Design Patterns is mentioned: [Pg.7]    [Pg.11]    [Pg.7]    [Pg.11]    [Pg.728]    [Pg.85]   
See also in sourсe #XX -- [ Pg.95 ]




SEARCH



Design pattern

© 2024 chempedia.info