The IBM Rational Software Development Platform is an Eclipse-based common development environment that is shared by the following products:
- IBM® Rational® Web Developer
- IBM® Rational® Application Developer
- IBM® Rational® Software Modeler
- IBM® Rational® Software Architect
- IBM® Rational® Functional Tester
- IBM® Rational® Performance Tester
It is an integrated platform that allows you to manage and trace your project from requirements through design and development.
One component of the IBM Software Development Platform is the IBM Rational Software Modeler. Rational Software Modeler is a Unified Modeling Language (UML)-based visual modeling and design tool for architects, systems analysts, and designers who need to ensure that their specifications, architecture, and designs are clearly defined and communicated to their stakeholders. For example, the tool is designed to help users translate requirements into use cases and other artifacts, based on UML, such as class diagrams and sequence diagrams. Rational Software Modeler is a customizable tool that enables you to clearly document and communicate these system views. Rational Software Modeler also supports team development by integrating with other tools in your environment. This integration helps enable project teams to collaborate and track a project through its life cycle. Simply put, Rational Software Modeler is a UML modeling tool on steroids.
Rational Software Modeler and Eclipse
The IBM Software Development Platform is integrated with Eclipse, which results in a richer and more user-friendly toolset. Eclipse is an open source integrated development environment (IDE) that is fast gaining popularity. More and more developers are adopting Eclipse because of its usability features and development plug-ins. (For more information about Eclipse, refer to the Resources section at the end of this article.) Rational Software Modeler includes and benefits from core Eclipse paradigms such as perspectives, which enable you to switch your view to show the toolbars you need. The perspectives and features that you most often use in Rational Software Modeler are:
- Modeling perspective: Use this view to create and manage your UML assets. All the assets that you create are Eclipse resources, which means that you can work with them using the Eclipse IDE. Rational Software Modeler allows you to build any UML diagram: use case diagrams, class diagrams, sequence diagrams, collaboration diagrams, and so on.
- Requirements perspective: This view is for integration with IBM® Rational® RequisitePro® (discussed further toward the end of the article).
- Model Publishing: This feature allows you to publish your model so that others can view it.
You can store either your raw UML models or the source code generated from the models. In addition, although there are no automated synchronization features between the UML models and the code, you can easily generate one from the other. This feature is great for developers because they can see an initial version of their code right from the UML diagrams, saving them up-front development time. In my experience, developers are more motivated to spend additional time during the design phase when they know that they'll get something tangible from it. (See the article Introducing Rational Software Architect, listed in the Resources section for more information about code-generation features.) So, let's jump in.
Simple UML modeling
You can use Rational Software Modeler to create basic UML models, use case diagrams, class diagrams, and sequence diagrams. You'll learn how to create use case diagrams first.
Create a use case diagram
You can use UML use case diagrams to describe the functionality of a system. Use cases have four major elements:
- Actors: Interact with the system; typically appear as stick figures in a use case diagram (although this tool shows a graphic that looks like a person)
- Use cases: Describe the functionality of the system; appear as ovals in the diagram
- System: The system itself
- Relationships: Demonstrate the relationships among the above three elements; appear as lines in the diagram
Begin by launching Rational Software Modeler (you'll gain more from this article if you follow along in the tool).
- From the File menu, create a new UML project called BookStore--in other words, click File > Create, then type Bookstore in the UML Project field. (As you can tell, you're going to model a simple book store.)
- Create a use case model under the BookStore project.
Your Rational Software Modeler window should look like that shown in Figure 1.
Figure 1. Use case model for the BookStore project
Next, create a use case diagram. First, create Versatile Actors, which are actors that will be shared across different use cases.
- Right-click the Versatile Actors tab, then create two actors: Customer and Administrator.
- Drag these actors onto the use case diagram.
- Using the palette, create four use cases for the Customer actor called Search Books, Browse Catalog, Order Book, and Manage Account.
- For the Administrator actor, create two use cases called Ship Book and Manage Catalog.
- Now, create an actor called System to handle payment processing.
Figure 2 shows these actors and use cases.
Figure 2. Actors and use cases for the BookStore project
You've just created a basic use case diagram. Now, you need to extend that diagram to include relationships.
- Begin by expanding the Manage Account use case into the different pieces that make up the larger use case.
- Assume that the Manage Account use case is made up of two use cases: Create User Account and Edit User Account.
- Both of these use cases in turn consist of three detailed use cases: Update User Profile, Update Shipping Information, and Update Payment Information.
Figure 3 shows these relationships.
Figure 3. Details for the Manage Account use case
Congratulations! You've just built your first use case diagram in Rational Software Modeler, complete with actors, use cases, the system itself, and different relationships between the use cases. Now, you'll build a class diagram.
Create a class diagram
A class diagram describes the various classes in your system, as well as the relationships between those classes. Class diagrams are used for a variety of purposes. They help you:
- Understand the requirements and describe the detailed design of your system. (Architects typically build class diagrams in collaboration with development teams, which enables the developers to understand fully what they'll be implementing.)
- Apply design patterns and visualize how your system will behave.
Class diagrams are one of the best handshakes between architects and developers. The question is, how do you distinguish the classes from the use cases? A good rule of thumb is that each noun in your use case is a candidate to become a class in your code. (For more information about getting from use case to class diagram to code, refer to the Resources section.)
You'll perform these steps to build a class diagram called Class Diagram:
- Right-click the use case model in the Model Explorer.
- Create a class called Customer.
- Beneath the Customer class, create four attributes called
- Create a class called Address. (Don't worry about adding the attributes right now.)
- Beneath the Address class, create two more classes called BillingAddress and ShippingAddress. These classes should be generalized from the Address class (see Figure 4).
- Create a one-to-many relationship between the Customer class and the Address class.
- Create a class called CreditCard.
- Add three attributes to the CreditCard class called
- Create a one-to-one relationship between the CreditCard class and the BillingAddress class.
- Create a one-to-many relationship between the Customer class and the CreditCard class.
Figure 4 shows the class diagram you've just created. Complete your class diagram to include other classes, such as Catalog, Book, and Order. You can perform this procedure on your own as an exercise.
Figure 4. The newly created class diagram
So far, you've created a use case diagram and a class diagram. Now, you need to create another type of diagram: a sequence diagram. UML sequence diagrams are typically used to:
- Validate and flesh out the logic of a use case
- Visually communicate your requirements to your developers
- Help you understand the interaction between your objects so that you can identify potential design issues
- Identify any complex classes or issues that require more detailed design
I think that these three elements -- use cases, class diagrams, and sequence diagrams -- are the bare essentials of any software design document. The other UML diagrams definitely have value, but given the time limitations on a project, you should create at least these three diagrams before jumping into development.
Create a sequence diagram
To create a simple UML sequence diagram:
- First, use the Model Explorer to create a new sequence diagram.
- Then, drag and drop the Customer, Address, and CreditCard classes -- and the Update User Profile use case -- onto this sequence diagram.
- Using the palette, create the following sequence of steps (see Figure 5).
- Customer calls the
updateProfilemethod, which is part of the Update User Profile use case discussed previously.
updateProfilemethod then calls the
updateAddressmethod on the Address class.
updateProfilemethod calls the
updateCreditCardmethod on the CreditCard class.
updateProfilemethod then returns to the Customer class.
- Customer calls the
Figure 5. Newly created sequence diagram
In Rational Software Modeler, you could have also chosen to create a UML collaboration diagram, which describes the interaction between objects and the order of the messages that they exchange. These diagrams are relatively quick to draw. Collaboration diagrams and sequence diagrams contain almost identical information, so it's really up to each development team and the architects as to which diagram they prefer. It's probably overkill to have both, and I prefer sequence diagrams because they are more specific about the sequence of events and, as a result, add more value. Also, building the appropriate algorithmic logic is easy from a sequence diagram. However, if your preferences run to the contrary, I recommend that you explore the collaboration diagram feature in Rational Software Modeler.
Integration with Rational RequisitePro
One key feature of the IBM Software Development Platform is its complete end-to-end integration with the software development life cycle. The Rational Suite provides this integration from a toolset perspective. Using these tools, information technology (IT) teams can collaborate -- starting with requirements and moving on to design, development, testing, and deployment -- all within the same tool framework.
Of particular importance is the integration between Rational RequisitePro and Rational Software Modeler. (For more information about Rational RequisitePro, refer to the Resources section.) This integration allows you to trace your requirements to specific elements in your design. For example, you can tie your use cases to specific requirements. Use cases are in turn tied to the class diagrams and sequence diagrams that define the application. These ties allow developers to navigate easily from design elements to requirements.
This article doesn't show you how to create your requirements in Rational RequisitePro. Instead, it assumes that you have a Rational RequisitePro project with some requirements and use cases defined. (As long as you have licenses for Rational RequisitePro and Rational Software Modeler, you don't need anything else to enable the integration.)
Now, in Rational Software Modeler, open the Requirement perspective. Use the Requirement Explorer to open your Rational RequisitePro project.
This example contains a simple Rational RequisitePro project with two requirements of type Use Case: one for Search Books and the other for Browse Catalog. In Rational Software Modeler, perform the following steps:
- Open the use case diagram
- Simply drag and drop the requirements from the Requirement Explorer onto the appropriate use case in the diagram
- A small arrow appears next to the name of the requirement in the Requirement Explorer to show that the requirement is linked (see Figure 6)
- By right-clicking the use case in the UML diagram and selecting Requirement, you'll be able to navigate directly to the requirement in Rational RequisitePro
Figure 6. Linked requirements in the Rational RequisitePro project
Publish your model
Publishing your finished model to the Web is easy. Rational Software Modeler automatically generates the HTML and images from your model. (This feature is similar to Javadoc" generation in the Java" technology environment.) The output files closely resemble the format that API documentation takes -- a format familiar to all Java technology developers. Even non-Java technology developers who might not be familiar with the Javadoc tool will find it easy to navigate this structure. The output is nicely cross-linked, and you can easily navigate through all the different model assets that you have chosen to export.
To actually publish the model, click Modeling > Publish. Figure 7 shows this output in a Web browser. Rational Software Modeler also offers an option for exporting your model to Adobe® PDF format.
Figure 7. Use Rational Software Modeler to export HTML
This article showed you how to use Rational Software Modeler to create simple use case diagrams, class diagrams, and sequence diagrams based on the UML 2.0 standards. You also learned how to tie these UML assets to requirements in Rational RequisitePro so that you can manage and trace your requirements to each design element. Finally, you saw how easy it is to export your completed model to the Web. Your published model becomes a valuable asset to the design document you build for your application.
- Get the evaluation version of Rational Software Modeler, Rational RequisitePro, and Rational Unified Process from the Trials and betas page.
- The article Introducing IBM Rational Software Architect (developerWorks, February 2005) introduces IBM Rational Software Architect and the modeling capabilities that Rational Software Architect provides.
- The article Understanding and Customizing Model Publishing in IBM Rational Software Modeler/Architect (developerWorks, February 2005) shows how model publishing provides the means to publish models in HTML.
- The article How to migrate from code-centric to model-centric development using Rational Software Architect (developerWorks, January 2005) shows how you can develop higher-quality software more efficiently using a model-driven development approach.
- The article OO design process: Use cases, an introduction provides the basics of use-case analysis.
- The article Getting from use cases to code Part 1: Use-Case Analysis provides valuable information about generating code from your use cases.
- The whitepaper The Modeling Structure Guidelines (developerWorks, January 2005) provides information that will help you better use the concepts described in this article.
- You can read more about UML 2.0 at the UML Resource Center.
- For details and more information about the Eclipse 3.0 platform, visit the Eclipse home page.
- Rational Software Modeler ships with a rich set of Help files and tutorials. See the Help menu within the tool for more information.
- The IBM Software Developer Platform homepage provides detailed information on the overall IBM Software Development platform, of which IRAD, IRSA, IRSM, and the other products listed in this article, are a part.
- For technical resources about Rational's products, visit the developerWorks Rational content area. You'll find technical documentation, how-to articles, education, downloads, product information, and more.
- Find more product related information by visiting the IBM Rational marketing pages.
- Get involved in the developerWorks community by participating in developerWorks blogs.
- Ask questions about Rational Software Modeler and Rational Software Architect in the Rational Software Architect, Software Modeler, Application Developer and Web Developer forum.
- Browse for books on these and other technical topics.
Dig deeper into Rational software on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.