Purpose
The steps in this tool mentor match those in the task. Links to topics in the Rational Software Architect (RSA) online
Help are marked with .
Overview
This tool mentor describes the steps for creating a simple service model using RSA. The UML Profile for Software
Services and the template model described in this tool mentor may not be installed in earlier versions of RSA. A
downloadable package which contains these items and installation instructions is available from IBM developerWorks.
The following steps are performed in this tool mentor:
This step will also create a Service Design Model, once complete jump to step number 3.
-
From the RSA menu, select File --> New --> Project.
-
In the resulting wizard, select the "Modeling" folder and then the "UML Project" from the tree. If these elements
are not visible in the tree, check the box "Show All Wizards" just below the tree. Select the Next button.
-
Give your project a name such as "my.first.servicemodel.project" and then select the Next button.
-
From the list of model templates, select "Service Design Model" and then select the Next button.
-
When presented with the list of projects you may reference, select the Finish button.
For more information on creating a new project, see the State Transition topic in the Rational Rose online help.
If you already have a modeling project, this step will add a Service Design Model to your project.
-
Select the project to add the Service Design Model to.
-
From the RSA menu, select File --> New --> Other.
-
In the resulting wizard, select the "Modeling" folder and then the "UML Model" from the tree. If these elements are
not visible in the tree, check the box "Show All Wizards" just below the tree. Select the Next button.
-
From the list of model templates select "Service Design Model" and if you wish, you can choose a new name for your
model. Select the Finish button.
-
In the package named "Message View," create a new Class named Customer.
-
Create another new Class named Address.
-
Create an aggregation association from Customer to Address.
-
Open the model library named "Reusable Design Elements" and ctrl-drag the <<Message>> Class into the
message view package.
-
Right-click on the newly created class in the message view and select "Find/Replace...."
-
In the dialog type, the text "${service.message}" in the "Find What" text box.
-
Select the "Replace" button.
-
In the dialog type the text "CreateCustomer" in the "Replace with" text box.
-
Select OK.
-
Drag the new message class onto the class diagram with Customer and Address and add an aggregation association from
CreateCustomer to Customer.
-
Now ctrl-drag another <<Message>> Class into the message-view package and rename it
"UpdateCustomerAddress" using the find/replace dialog.
-
Drag the new message class onto the class diagram and add an aggregation association from UpdateCustomerAddress to
Address.
-
Ctrl-drag the <<ServiceProvider>> Component into the service view package and, using the find/replace
technique described above, rename it "CustomerInfo" (the "Find what" text is "${service}" in this case).
-
The actual elements created are:
-
A Component named "CustomerInfoProvider" with a nested composite structure diagram.
-
An Interface named ICustomerInfo stereotyped as a <<ServiceSpecification>> and containing an
Activity diagram.
-
A Port on the component named CustomerInfo stereotyped <<Service>> and typed as ICustomerInfo.
-
Add an operation to ICustomerInfo called "createCustomer" and add a parameter typed with the CreateCustomer message
created above.
-
Add another operation called "updateCustomerAddress" and add a parameter typed with the UpdateCustomerAddress
message created above.
-
Create another service, following the instructions above, but name it "AccountMgmt" (no need to add operations in
this case).
-
Ctrl-drag the <<ServicePartition>> Node into the collaboration view package and, using the find/replace
technique above, rename it "Back Office." The "Find what" text is "${partition}" in this case.
-
Open the structure diagram nested in the partition and add two parts to the diagram, when prompted choose to select
an existing element, and choose the two service providers created so far.
-
This should result in the parts not only being typed but also displaying the ports and interfaces associated with
the providers.
-
To create a service channel between the two services, choose the Connector from the toolbox and connect to the two
ports.
-
Stereotype the connector <<ServiceChannel>>.
-
Select the Advanced tab in the properties view and set the binding to "RMI."
To create a strict partition and expose only the AccountMgmt service, follow the additional steps below.
-
Right click on the Partition in the Model Explorer and add a new Port.
-
Name the Port and set its stereotype to <<ServiceGateway>>.
-
In the properties view, set the Type of the Port to the IAccountMgmt service specification.
-
Open the composite structure diagram we created above and see that the new Port is shown on the diagram.
-
Create a <<ServiceChannel>> from service gateway to the AccountMgmt service.
|