Download Software Engineering, Course notes 1996/1997
Transcript
Software Engineering 6.1.4.2 System Design A Client of a Component For a client of a component, the client’s primary interest is the interface of the component. The interface consists essentially of the export declarations of the component. Since the resources declared in the export declarations may reference resources defined in other components of the system, such referenced components must thus be imported and made available to the clients through the components’s interface. 6.1.4.3 The Service, the Service Primitives, and the Protocol A component provides a service to other subsystems. A service is a group of related functions, the so-called service primitives, that share a common purpose. An example of a service is a file system of a computer which provides service primitives for creating, naming, renaming, manipulating, and deleting files and directories. A service primitive is characterised by its signature and its semantics: • • • • a name (or address, sometimes also called a service access point) the type and number of parameters as arguments the type of the result the description. The protocol of a service is characterised by the set of service primitives the component provides, and by a set of communication rules (legal sequences of using the service primitives) that specify the form of all interactions across the boundaries of the component. 6.1.4.4 Client/Server or Peer-to-Peer Relations among Components The communication between two components can be client-server or peer-to-peer. In a client-server relationship, the client calls on the server, which performs some service and replies with a result. The client must know the server’s interface (i.e., informations such as the service name and/or the address of the service), but the server does not have to know the interfaces of its clients, because all interactions are initiated by the clients. The communications relation is said to be asymmetric. The USES relation is not circular. Figure 6-4 illustrates the temporal order of a client-server interaction. FIGURE 6-4 Client-Server Interaction Client Server client sets up request client waits for response server is idle server receives request and prepares reply client continues server is idle time time A peer-to-peer relationship has a symmetric communications relationship. Each component may call on the others. A communication from one component is not necessarily followed by an immediate response. Peer-to-peer interactions are more complicated because: • each component must know each other’s interface • it introduces a circular USES relation • communication cycles can exist that are hard to understand. IS Biel/DUE 96/97 6-6