Skip to main content

Scenarios of working in a team development environment: Using IBM Rational Software Architect and CVS

Dejan Custic (dcustic@ca.ibm.com), Information Developer, IBM Software Group, Rational
Dejan Custic is an information developer at IBM Rational in Kanata, Ontario, Canada.

Summary:  This article explains how to set up and work in a team environment with Rational Software Architect by importing an existing project and practicing model-driven, team-oriented development. The scenario in this article specifically involves two roles: configuration manager and developer. The user ID for the configuration manager is cvs_admin. The two developers have the user IDs dev1 and dev2.

Date:  10 Nov 2005 (Published 27 Sep 2005)
Level:  Intermediate
Activity:  512 views
Comments:  

Before you begin: Installing and configuring software

You must perform key software installation and configuration tasks before you set up your environment.

Prerequisites

The following software must be installed on client workstations:

  • Rational Software Architect 6.0
  • Concurrent Versions System 3.0.1

CVS repository assumptions

This scenario assumes that your Concurrent Versions System (CVS) repository is created and configured for all three users.


Sharing a modeling project

You share a modeling project, so that other team members can also work on it. In this section, you start Rational Software Architect as cvs_admin, import a modeling project, and share it in CVS.

Starting Rational Software Architect

Start Rational Software Architect and create an initial workspace.

To start Rational Software Architect:

  1. Click Start > Programs > IBM Rational > IBM Rational Software Architect V6.0 > Rational Software Architect.
  2. In the Workspace Launcher window, in the Workspace field, specify a workspace and click OK.

Note: Your CVS repository location and your Rational Software Architect workspace should always be separate.

Importing an existing modeling project

In this exercise, you import an existing modeling project called Piggy Bank. In accordance with the Rational Unified Process (RUP), the Piggy Bank sample UML model is divided into three models that each describe a different aspect of the system: the use-case model, analysis model, and design model.

To import the Piggy Bank modeling project:

  1. Click Help > Samples Gallery.
  2. In the Contents pane, navigate to Application samples > Piggy Bank Application > Piggy Bank Models.
  3. In the right pane, click Import the sample.
  4. In the Sample Banking Models wizard, on the Piggy Bank Models page, accept the default project name and click Finish.
  5. Close the Samples Gallery.

    The following figure illustrates how the Piggy Bank modeling project is displayed in the Model Explorer view.


    Figure 1. Piggy Bank modeling project
    Piggy Bank modeling project

Sharing a project

Share your project to allow other team members to access it.

To share your project:

  1. In the Model Explorer view, right-click Piggy Bank Models; then click Team > Share Project.
  2. In the Share Project wizard, on the Share Project page, click CVS and click Next.
  3. On the Share Project with CVS Repository page, click a repository location and click Next.
  4. On the Enter Module Name page, click Use project name as module name and click Next.
  5. On the Share Project Resources page, click Commit All Changes.
  6. In the Add to CVS Version Control window, click Yes.
  7. In the Commit window, type Share project and click OK.
  8. On the Share Project Resources page, click Finish.

Adding to the modeling project

Make changes to your models and store them in CVS, so that other team members can view them. Update a use-case diagram with an action.

To update a use-case diagram:

  1. In the Model Explorer view, double-click Use Case Model.emx.
  2. Navigate to Use Case Model > Account Operations > Display Balance > Display Balance and double-click Display Balance Activity Diagram.
    Figure 2. Opening the Display Balance Activity Diagram
    Opening the Display Balance Activity Diagram
  3. In the Palette, click Action.
  4. In the diagram editor, click above Display Accounts with balance.
  5. In the diagram editor, rename Action to Select Account.
  6. In the Palette, click Control Flow.
  7. In the diagram editor, click Select Account and drag the cursor to Display Accounts with balance.
  8. In the guard condition, type [true].
  9. Click the end of the guard condition that points to Display Accounts with balance and drag the cursor to Select Account.

    The following figure illustrates how a new action is displayed in the diagram editor.


    Figure 3. Creating an action
    Creating an action
  10. To save your changes, click File > Save All.

Committing your work to the repository

Commit your changes to the repository, so that other users can view them.

To commit your work to the repository:

  1. In the Model Explorer view, right-click Piggy Bank Models; then click Team > Synchronize with Repository.
  2. In the Synchronize view, in Outgoing Mode, right-click Use Case Model.emx; then click Commit.
  3. In the Commit Comment window, type Create Action and click OK.

Developing models as part of a team

At this point in the scenario, the administrator has finished setting up the development environment. In this exercise, the focus switches to the development process and to two developers with the user IDs dev1 and dev2.

Setting up work areas for the developers

In this exercise, you set up the individual work areas for dev1 and dev2. This exercise assumes that the CVS repository is already created and configured for dev1 and dev2.

  1. Log in as dev1.
  2. Click Start > Programs > Rational Software > Rational Software Architect.
  3. In the CVS Repository Exploring perspective, expand HEAD.
  4. Right-click Piggy Bank Models; then click Check Out As.
  5. To load Piggy Bank models into your workspace, in the Check Out As window, click Finish.
  6. To set up another work area for dev2, repeat steps 1 through 5.

Adding to the modeling project

As dev2, make a change to a use-case diagram by renaming an action.

To rename an action:

  1. In the Model Explorer view, double-click Use Case Model.emx.
  2. Navigate to Use Case Model > Account Operations > Display Balance > Display Balance and double-click Display Balance Activity Diagram.
  3. In the diagram editor, rename Display Accounts with balance to Display Selected Account.
  4. Click File > Save All.

    The following figure illustrates how a renamed action is displayed in the diagram editor.


    Figure 4. Renaming an action
    Renaming an action

Committing your work to the repository

Commit your changes to the repository, so that other users can view them.

To commit your work to the repository:

  1. In the Model Explorer view, right-click Piggy Bank Models; then click Team > Synchronize with Repository.
  2. In the Synchronize view, in Outgoing Mode, right-click Use Case Model.emx; then click Commit.
  3. In the Commit Comment window, type Rename Action and click OK.

Updating the work area for dev1

Update the work area for dev1 with the latest changes that dev2 committed to the repository.

To update the work area for dev1:

  1. Log in as dev1.
  2. Click Start > Programs > Rational Software > Rational Software Architect.
  3. In the Model Explorer view, right-click Piggy Bank Model; then click Team > Synchronize with Repository.
  4. In the Synchronize view, in Incoming Mode, right-click Piggy Bank Model; then click Update.

Starting parallel development: Comparing and merging models

In this exercise, you perform parallel development. The two users on your team make different changes to the same model element. In the next exercise, the second user tries to synchronize with the repository, and then must perform a merge to resolve the differences.

A merge typically starts when you check in a model to a configuration management system and a newer version of the same model already exists in the repository. At the start of the merge, all non-conflicting differences and trivial conflicts are resolved automatically. You must then manually resolve the remaining conflicts by selecting a version of a model from which to accept changes. After you resolve the remaining conflicts, you can save the merged model and close the merge editor.

Introducing conflicts to the model

In this exercise, dev1 introduces a change to a file, then commits the file. When dev2 makes a conflicting change to the same file, dev2 must merge the two files before committing changes to the repository.

To create a conflicting change:

  1. As dev1, in the Model Explorer view, double-click Use Case Model.emx.
  2. Navigate to Use Case Model > Account Operations and double-click Account Operations Use Cases.
  3. In the diagram editor, rename Teller to Auditor.
  4. Click File > Save All.
  5. Commit your changes to the repository:
    1. In the Model Explorer view, right-click Piggy Bank Models; then click Team > Synchronize with Repository.
    2. In the Synchronize view, click Outgoing Mode.
    3. Right-click Use Case Model.emx; then click Commit.
    4. In the Commit Comment window, type dev1 changes and click OK.
  6. To exit Rational Software Architect, click File > Exit.
  7. Log in as dev2.
  8. In the Model Explorer view, double-click Use Case Model.emx.
  9. Navigate to Use Case Model > Account Operations and double-click Account Operations Use Cases.
  10. In the diagram editor, rename Teller to Manager.
  11. Click File > Save All.

Resolving the conflict

At this point, dev1 and dev2 have both made changes to the same file. The dev1 user has committed changes. The dev2 user has not yet committed changes. When dev2 synchronizes with the repository, a merge initiates and dev2 must resolve any conflicts that exist before committing changes to the repository.

To resolve the conflict:

  1. As dev2, in the Model Explorer view, right-click Use Case Model.emx; then click Team Synchronize with Repository.
  2. In the Synchronize view, in Incoming Mode, double-click Use Case Model.emx (which is identified by a conflict icon).
  3. Click Synchronize.

    The Merge window opens. You can view the differences and conflicts between contributor and ancestor files in the Left, Right, and Ancestor views. You can also view details about each difference and conflict in the Structural Differences view. The Merged result view displays the merged model.

  4. To accept the change that dev2 made, in the Merge window, in the Structural Differences view, right-click Conflicting changes; then click Resolve with Left Contributor.
    Figure 5. Resolving a conflict
    Resolving a conflict
  5. In the Merged result view, click Save as Left contributor.
    Figure 6. Saving a merged model
    Saving a merged model
  6. Close the Merge window.
  7. In the Synchronize view, in Incoming Mode, right-click Use Case Model.emx; then click Mark as Merged.
  8. Click Outgoing Mode.
  9. Right-click Use Case Model.emx; then click Commit.
  10. In the Commit Comment window, type merged use-case model and click OK.

The merge is now complete and the results are under CVS control.


Conclusion

This concludes the initial setup of a team development infrastructure. This article also concludes the series of scenarios designed to cover the use of Rational Software Architect in a team environment, practicing model-driven, team-oriented development.


Resources

Learn

Get products and technologies

Discuss

About the author

Dejan Custic

Dejan Custic is an information developer at IBM Rational in Kanata, Ontario, Canada.

Comments



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=94214
ArticleTitle=Scenarios of working in a team development environment: Using IBM Rational Software Architect and CVS
publish-date=11102005
author1-email=dcustic@ca.ibm.com
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers