Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Hello World: Rational Software Architect

Design a simple phone book application

Tinny Ng (tng@ca.ibm.com), Advisory Software Developer, IBM Toronto
Tinny Ng
Tinny Ng is a scenario architect at the IBM SWG Scenario Analysis Lab, whose mission is to improve the cross-brand integration capability of IBM SWG products. She has more than 10 years of experience in software development, from design to implementation, including application building, packaging, testing, and support.
(An IBM developerWorks Contributing Author)

Summary:  Welcome to the first tutorial in the "Hello, World! Series", which will provide high-level overviews of various IBM software products. This tutorial introduces you to IBM Rational Software Architect, and highlights some basic features of Rational Software Architect with a hands-on exercise. Learn how to design an application using UML diagrams, publish the model information into a Web page, and transform the design to Java code using Rational Software Architect.

View more content in this series

Date:  05 May 2006
Level:  Introductory PDF:  A4 and Letter (703 KB | 24 pages)Get Adobe® Reader®

Activity:  48713 views
Comments:  

Creating a sequence diagram

A sequence diagram in UML shows the chronological sequence of messages between instances in an interaction. It consists of an interaction that is represented by lifelines and the messages that they exchange over time during the interaction.

In this section you're going to realize the use case "Search for a phone number" and show the associated interaction using a sequence diagram. The use case starts with the actor Any User, who makes use of the interface provided by PhoneBookView to request a search. PhoneBookView notifies PhoneBookController about the user's request. PhoneBookController then updates the data model that is stored in PhoneBookModel. Because there is a change of the model, PhoneBookModel notifies PhoneBookView, which should then refresh the user interface to reflect the latest state of the application.

Would you like to see these steps demonstrated for you?

Show me Show me

  1. In the Model Explorer view, right-click Phone Book UML Model and select Add Diagram > Sequence Diagram.
  2. Enter Sequence Diagram as the name of the generated diagram to replace the default name Diagram1.
  3. Drag the actor Any User from the Model Explorer view to the diagram to create an instance of the actor, as shown in Figure 10. Similarly, create instances of PhoneBookView, PhoneBookController and PhoneBookModel by dragging them to the diagram.

    Figure 10. Drag the model elements to the sequence diagram
    Drag the model elements to the sequence diagram
  4. Select Asynchronous Message in the Palette. As shown in Figure 11, click the line under any User: Any User and then the line under phoneBookView:PhoneBookView.

    Figure 11. Create message line
    Create message line
  5. Select the operation PhoneBookView::getUserInput() from the drop down list.

    Figure 12. Select operation for a message line
    Select operation for a message line
  6. Similarly, create the following Asynchronous Message lines shown in Table 3. To create an Asynchronous Message to call itself, simply click the instance bar directly without any dragging.

    Table 3. Message lines for the sequence diagram

    From instanceTo instanceOperation
    phoneBookViewphoneBookControllerPhoneBookController::userHasInput()
    phoneBookControllerphoneBookModelPhoneBookModel::searchPhoneNumber()
    phoneBookControllerphoneBookModelPhoneBookModel::setState()
    phoneBookModelphoneBookViewPhoneBookView::stateHasChanged()
    phoneBookViewphoneBookModelPhoneBookModel::getSearchResult()
    phoneBookViewphoneBookViewPhoneBookView::changeView()
  7. The complete sequence diagram should look like Figure 13. Select File > Save All to save everything.

    Figure 13. Complete sequence diagram
    Complete sequence diagram

8 of 14 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational, Java technology
ArticleID=110599
TutorialTitle=Hello World: Rational Software Architect
publish-date=05052006
author1-email=tng@ca.ibm.com
author1-email-cc=