< Previous | Next >

Lesson 5: Create the SchedulingContract Service Contract

This content applies to version 7.5.4 or later. You can now create a simple service contract for the SchedulingService service interface; this service does not require a behavior to be created. The service contract contains parts that represent its user and provider that you can use later in the services architecture.
To create the SchedulingService service contract:
  1. In the Project Explorer view, in the contracts package, open the Main diagram.
  2. In the Palette, click Service Contract, drag the cursor below the InvoiceContract service contract, and name it SchedulingContract.
  3. In the Project Explorer view, right-click the SchedulingContract service contract; then click Add Services Modeling > Part and click Unspecified.
  4. In the diagram editor, click the new part in the SchedulingContract element.
  5. In the Properties view, name the part client, for the part name and specify the type as the SchedulingService interface.
  6. To create another part, repeat step 3 to step 5, but name this part scheduler and set its type to the SchedulingService interface. The SchedulingContract service contract should look like the following:

Create the ShippingContract service contract

You can now create a service contract for the ShippingService service interface. The ShippingService service contains a behavior that you represent in a sequence diagram.
  1. In the Project Explorer view, in the contracts package, open the Main diagram.
  2. In the Palette, click Service Contract, drag the cursor below the SchedulingContract service contract, and name it ShippingContract.
  3. In the Project Explorer view, right-click the ShippingContract service contract; then click Add Services Modeling > Part and click Unspecified.
  4. In the diagram editor, click the new part in the ShippingContract element.
  5. In the Properties view, name the part shipper , and specify its type as theShipping interface.
  6. Repeat step 3 to step 5, and name the part orderer and specify its type as the ScheduleProcessing interface. The ShippingContract service contract should look like the following:
Your completed diagram should look like this:

Add a sequence diagram to the ShippingContract service contract

You add a sequence diagram to the ShippingContract service contract to show the sequence of messages between the shipper and orderer.
To add a sequence diagram to the ShippingContract service contract:
  1. In the diagram editor, right-click the ShippingContract service contract; then click Add Diagram > Sequence Diagram.
  2. In the Properties view, on the General page, name the sequence diagram, click Set and click protocol.
  3. In the Palette, click a lifeline and drag the cursor into the diagram.
  4. In the window, click Select Existing Property and click the shipper part from the ShippingContract service contract.
  5. In the Palette, click a lifeline and drag the cursor into the diagram.
  6. In the window, click Select Existing Property, and click the orderer part from the ScheduleProcessing service interface The sequence diagram should look like the following:
  7. In the Palette, click beside Synchronous Message and click Asynchronous Message.
  8. In the diagram editor, click the orderer lifeline and drag the cursor to the shipper lifeline.
  9. In the window, click requestShipping operation.
  10. In the Palette, click Asynchronous Message.
  11. In the diagram editor, click the shipper behavior specification and drag the cursor to the orderer lifeline.
  12. In the window, click processSchedule operation.

Service contract checkpoint

You created three service contracts in a single package for the Invoicing, Scheduling, and Shipping service interfaces. You added an activity diagram and a sequence diagram to the contracts. The Main diagram should look like the following:

You did not create a service contract for the Purchasing service interface; later, you use a services architecture to specify additional details about the Purchasing service.

In the next lesson, you create the participants that interact with the application services.

< Previous | Next >

Feedback