Tool Mentor: Create Service Interfaces from Candidate Services
Create Service Interfaces from candidate services by using Rational Software Architect
for WebSphere Software.
Tool: Rational Software Architect
Relationships
Related Elements
Main Description

Overview

This tool mentor describes how to create ServiceInterfaces and to note their exposure from candidate services, which are modeled using SoaML Capabilities. The instructions apply for Rational Software Architect for WebSphere Software, Version 7.5.4 or later.    

The following steps are performed in this tool mentor:

Model element creation techniques are described in Tool Mentor: Create SoaML Model Elements. Those instructions are not repeated here.

Review the model structure

The following diagram illustrates the portions of the service model structure that are used in this tool mentor.   Notable aspects include:

  • Capabilities are created in the Capabilities package.  
  • An implementation package structure -- the part of the model that "owns" the ServiceInterfaces and supporting model elements -- has been created.
  • Important elements like ServiceInterfaces are packaged with supporting elements, such as diagrams.
  • Two building blocks are available to create ServiceInterface packages and the elements they contain: 
    • In one case, we create a ServiceInterface that is a stereotyped Class. This is used when the service is involved in more than simple request-response communication patterns and thereby requires at least one provided interface and at least one required interface.  
    • In the other case, we create a ServiceInterface that is a stereotyped Interface.   This is used when the service is involved only in simple request-response communication.

   
  

Create the ServiceInterface from a building block

  1. Determine where the ServiceInterface you are about to create needs to be located within the implementation package structure. In the Package Explorer, create the hierarchy of owning packages if it doesn't already exist.
  2. Select the appropriate ServiceInterface building block. If you aren't certain whether the ServiceInterface you are creating will be "simple" or "collaborative," select the "collaborative" building block.
  3. Copy the building block and paste it under the appropriate owning package structure.
  4. Use standard building block text find-and-replace procedures to name the elements of the building block appropriately.
  5. Create an <<Expose>> relationship from the ServiceInterface to the capability. There are many ways to do this. We describe one.
    • In the Project Explorer, select the newly created ServiceInterface.
    • Right-click and select the Add Services Modeling > Expose menu item.
    • Use the resulting dialog to identify the Candidate Service to which the relationship is to be created.

It can be useful to build one or more diagrams that graphically depict the expose decisions. A Free Form diagram under either the Capabilities package or the Services View is good for this. Communicate your decision to your fellow users, so that you collectively can be consistent in your approach. In our sample design model, we depict the <<Expose>> relationships on the Capabilities -- Overview diagram.

Create the ServiceInterface directly from a capability

Place the capabilities from which ServiceInterfaces are to be exposed onto a Free Form diagram under the Capabilities package.

  1. Select each such capability.
  2. Right-click, select Add Services Modeling and then either Simple or Collaborating ServiceInterface, whichever is appropriate.

A new ServiceInterface is created, owned by the package that owns the Free Form diagram you are using. An <<Expose>> relationship also is created from the ServiceInterface to the capability.

Relocate the ServiceInterface to the appropriate place in the implementation package structure.

  1. Determine where the ServiceInterface you created needs to be located within the implementation package structure.  
  2. In the Package Explorer, create the hierarchy of owning packages, if it doesn't already exist.
  3. Under this owning package structure, create a package with key words that indicate that it is a <<serviceSpecPackage>>.
  4. Cut and paste (or drag) the ServiceInterface from the Capabilities package and into the serviceSpecPackage.
More Information