Big Chemical Encyclopedia

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

Articles Figures Tables About

Pattern 16.14 Two-Way Link

In some cases, each object of a linked pair must know about the other. This in itself can add some final operations relating to the management of the link. An important pattern is a two-way link. When two objects refer to each other, it is important that they not get out of sync and point at different objects or point at a deleted object. Therefore, the only messages that immediately set up or take down the link should come from the object at the other end. When an object wishes to construct a two-way link with another object, it should set its own pointer and then register with the other. (See Pattern 16.14, Two-way link.)... [Pg.283]

The implementation of links typically induces further message sends. For example, setting up or taking down a two-way link requires a housekeeping message (see Pattern 16.14, Two-Way Link). [Pg.675]

The two classes—Subject and Observer—are related by Pattern 16.14, Two-Way Link. The association may be many-many. Once an Observer has registered with a Subject, any state changes cause the Subject to broadcast a notification to all its Observers. The notification must be appended to the code of any routine that might cause a change. [Pg.693]


See other pages where Pattern 16.14 Two-Way Link is mentioned: [Pg.687]   


SEARCH



© 2024 chempedia.info