A ServiceInterface can be a relatively complex construct, possessing multiple
provided and required simple interfaces. For example, see Concept: ServiceInterface (SoaML) and Example: ServiceInterface (SoaML), We provide rules that can be used to counter this
complexity and to reduce the effort that otherwise might be needed to define
ServiceInterfaces and their associated provided and required interfaces.
As they are written and illustrated here, the rules presuppose the use of
Interactions to describe service collaborations. This is not required. The rules
could be recast to use Activities or other behavioral representations.
Rule 1: Identify ServiceInterfaces by examining pairs of interacting
roles in a service collaboration. A service
collaboration can have numerous interacting roles. To simplify the process
of describing ServiceInterfaces, start by considering pairs of interacting roles.
This rule can be broken when it is appropriate to do so. ServiceInterfaces
can possess multiple provided and multiple required interfaces; therefore, they
can involve the interaction of three or more roles in a service collaboration.
However, start with the simplest case first. Add complexity (creating ServiceInterfaces
that involve more than two interacting roles) only when the solution requires
it.
Rule 2: Define the ServiceInterface and its provided and required
interfaces from the perspective of the role that is messaged first.
The role in the interacting pair that sends the first message is the consumer;
the role that receives the first message is the provider. Always define
ServiceInterfaces from the provider's perspective. In Example: Consumer and Provider Roles in Service Collaborations, we have an interacting
pair of roles, "role1" and "role2," with role2 as the provider. Define the ServiceInterface
and its provided and required interfaces from the perspective of role2.
Rule 3: Create either a simple UML Interface or a
ServiceInterface with only a provided interface when all consumer-provider communication
uses a request-response collaboration pattern. If all message calls
between the interacting roles are in one direction -- the consumer sends messages,
and the provider responds with conventional operation returns -- there is no
complex interaction protocol between the two. Either a simple UML interface
or a ServiceInterface with a single provided interface suffices. Example: Simple Interface from the Request-Response Collaboration Pattern illustrates
this.
Rule 4: Create a ServiceInterface with a provided interface and a required interface
when the provider role responds back to the consumer role with a callback
message. In this case, the provider role requires that the consumer be able to accept
messages, thus the provider requires an interface on the consumer. This is seen in Example: Complex ServiceInterface from "CallBack" Collaboration Pattern .
Example: ServiceInterfaces from a Complex Set of Role Interactions examines a
four-role collaboration to apply the ServiceInterface description rules at a larger scale.
|