Example: ServiceInterfaces from a Complex Set of Role Interactions
A service collaboration involving several roles is examined to define the ServiceInterfaces.
Relationships
Main Description

Guideline: Identify Service Interfaces from Collaboration Role Interaction Patterns introduced four rules for describing ServiceInterfaces and their provided and required interfaces, using interaction patterns between pairs of roles in Service Collaborations. Example: Simple Interface from the Request-Response Collaboration Pattern and Example: Complex ServiceInterface from "CallBack" Collaboration Pattern illustrated the two main creation rules, using simple examples involving interactions between only two roles. This illustration presents a more complex example. Here, we identify ServiceInterfaces in the context of a four-role Service Collaboration.

By applying Rule 2: Define the ServiceInterface and its provided and required interfaces from the perspective of the role that is messaged first, we see that we will be identifying three service interfaces here:

  • One for role2, which is the provider with respect to its interactions with role1.
  • One for role3, which is the provider with respect to its interaction with role2.
  • One for role4, which is the provider with respect to its interactions with role2.

Using 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, we see that the interaction between role2 and role3 fits this description. Therefore, we will create either a simple UML interface or a ServiceInterface with a single provided interface to address role3's perspective.

The interactions between role2 and role1, and between role4 and role2, are addressed by 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. Thus, as the diagram that follows show:

  • We will define a ServiceInterface with provided and required interfaces that are defined from the perspective of role2 relative to role1.
  • We will define a ServiceInterface with provided and required interfaces that are defined from the perspective of role4 relative to role2.

     

More Information