4 out: M3 out: M2 Fig. 2.22 An agent isolates external and internal interfaces The role of an agent is to map between external and internal messages or events. The agent has two sides that are specified independently, i.e. the external interface is independent from the internal structure. The agent holds a number of transaction specifications, one for each message or event that can trigger a behaviour when the agent is in an idle state. Most of these events are probably external messages or events, but spontaneous messages or events may be sent from x1 and x2 to the agent as well and result in external messages or events. Figure 2.22 shows, to the left, a scenario where the agent receives a message M1. If the agent accepts the message, it looks up the transaction specification for M1 and executes it. The transaction specification defines which internal units must be used, which internal messages or events should be sent and received and in which order. The transaction specification for M1 describes how the agent behaves (see the state diagram to the right) if it receives M1. Note that if the structure or func- tions of internal units are modified, it will not affect the external interface as long as the transaction specification is modified accordingly. Thus, the translation approach creates an excellent instrument (agents and transaction specifications) for requiring tracing between external and internal interfaces. Agents tend to become quite complex, capacity-demanding units. A considera- bly simpler approach is to implement interface units as discriminators. Four differ- ent forms of discrimination, representing different abstraction levels of external protocols, can be identified: message discrimination, abstract data discrimination, operation discrimination and (service) object discrimination. A well-known appli- cation of discrimination is the OSI seven-layer model, which comprises the first three forms. Figure 2.23 shows a simple example of message discrimination. The model is a substructure in two dimens