2. Integration

Integration patterns let independently developed components work together.

This category is closely related to the decoupling patterns. In fact, all but one pattern here, the adapter, can also be used for decoupling. I think, however, that the emphasis in this set is somewhat stronger on coupling preexisting or future components than on separating a system into components in the first place. Hence this separate category.

Adapter

Purpose: convert a given interface into another given interface.

Flexibility: no need to rewrite adaptee and its clients.

Implementation: adapter tranlates one interface into another.

Pipeline (Pipes and Filters)

Purpose: pass data through a sequence of transformations

Flexibility: transformations do not depend on each other; extensibility: replace/add/delete stages, change topology.

Implementation: defined input/output format, data passing protocol, adapters to match pipes.

Event-Based Integration

Purpose: let independent objects communicate indirectly, without knowing of each other.

Flexibility: integrate objects that know nothing or little of each other.

Implementation: participants register at common channel for events/data; pariticipants send events/data to channel; channel multicasts events to participants registered for events.

Mediator

Purpose: encapsulate how a set of objects interact.

Flexibility: interacting objects do not know about each other (loose coupling); change objects, change mediator;

Implementation: separate classes for objects and mediator; objects inform mediator of significant events by direct call to mediator or through event notification.

Propagator

Purpose: propagate changes through a network of dependent objects.

Flexibility: extend/shrink network, add new classes of objects to network.

Implementation: uniform registration and notification interface; direct registration or registration through event channel.

Subclasses:

Observer

Purpose: special case of propagator: only one level of dependencies.
Previous group Next group Back to the top