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]

Comparing and merging UML models in IBM Rational Software Architect: Part 10. Realign your models after migration or transformation

Kim Letkeman (kletkema@ca.ibm.com), Development Lead, Modeling Compare Support, IBM Rational
author photo
Kim joined IBM in 2003 with 24 years in large financial and telecommunications systems development. He is the development lead for the Rational Model-Driven Development Platform. His responsibilities include UML and EMF compare support, integrations with ClearCase, CVS, Jazz and RAM, domain modeling, patterns, transform core technology, transform authoring for both model to text and model to model transformations, and test automation.

Summary:  This article addresses issues of identity mutation as the result of migration to new versions of IBM® Rational® Software Architect across multiple streams, successive regeneration of a model through transformation, or successive model imports. If offers solutions that you can incorporate in your day-to-day work for a smooth and repeatable model-driven development workflow.

View more content in this series

Date:  19 Oct 2010
Level:  Intermediate PDF:  A4 and Letter (865 KB | 30 pages)Get Adobe® Reader®

Activity:  19410 views
Comments:  

Problems of broken lineage

There are several workflows that might need to address models of broken lineage.

Transformation

The layers in Model-Driven Architecture (MDA), as shown in Figure 1, include computationally independent models, platform independent models, platform-specific models, and software code. The process of moving downwards or upwards from one layer to another layer typically crosses modeling domains. This crossing of domains is often automated using transformation. Adding automation to MDA is typically called model-driven development, or MDD.

Model-driven development (MDD) is a concept whereby a system or application (typically in software. but it can really be anything) is visually modeled by using one or more modeling languages and then implemented with code, often written in a third-generation language that targets a specific runtime environment.


Figure 1. Transformations in Model-Driven Architecture (MDA)
MDA layers with indicated fusion points

When transforming across domains, such as from a process model to a service model or from Java™ code to a UML model, elements or the models' identities can be created or mutated if the two domains do not share identities when representing the same entity. For example, when Java™ code is generated by a Rational Software Architect transformation element, identities can be inserted into the code as comments or as annotations, thus the identities can be preserved when code is later refactored. In such a case, it is possible to make changes on either side and to make sense of the changes during both forward and reverse engineering.

However, in cases where the code is used to generate and maintain a UML representation, as shown in Figure 2, there will be no identities to preserve. Thus, new identities will be created on each execution of the transformation. If the models are to be useful for comparison purposes, the alignment of the newly generated (source) model to the previously existing (target) model must re-establish element identity.


Figure 2. Successive transformation between domains
Transformation and re-transformation in a stream

Model fusion (described later) is built into many transformations, and it is most often used when user intervention is expected. But if a development or build process must remain purely automatic, then model alignment followed by an automated merge would be preferred over fusion.

Migration

Terminology

The author uses Unified Change Management (UCM) terms such as "stream" as shorthand for grouping artifacts under development according to a common timeline (to designate the same group of files at the same versions). You might prefer to use "branch" or "context" to designate the artifacts that are grouped and managed together as they move forward in time.

When moving models across software versions, the UML metamodel and the notational metamodel both typically change. Examples of identity-mutating migrations are from IBM® Rational Rose® or IBM® Rational® XDE® to Rational Software Architect or from Rational Software Architect Version 6 to Rational Software Architect Version 7. Moving from XDE to Rational Software Architect, for example, changes the underlying metamodel from UML 1 to UML 2. This is a massive change with many changes to elements and many new elements, especially within the notational metamodel.

An example of the scope of the changes when moving to Rational Software Architect software is a customer migration that we performed with 100 individual models in two streams. One was a product variant of the other, as illustrated in Figure 3, but with two streams.


Figure 3. Multiple stream model migration between tooling releases
Migration from Version 1 to 2 on three streams

The number of differences per model between streams averaged 10 in the XDE stream set. After migration, the Rational Software Architect stream set showed an average of 10,000 differences per model. Obviously, because nothing else had changed, each model had almost 10,000 new (and quite superfluous) changes.

This customer's issue identified a critical need for a solution. We developed the Model ID Alignment tool in response.

In Figure 3, all models from Stream 1 are copied to Stream 2 and opened in the new tool, allowing the automated migration to take place. Each software configuration management (SCM) system provides this private working area for the new models in a slightly different way, but in all cases the models will be opened in the new tool and end up in a Version 2 "stream."

Import

A variation on migration is the successive importing of a model from an older version of the software. The example shown in Figure 4 was encountered and solved on a customer site. A model is migrated to Rational Software Architect from Rational Rose software and then maintained in both tools while the overall migration is evaluated and then staged.


Figure 4. Re-import when maintaining models in different tools
Import with fusion after changes in Rose and RSA

Changes made in the Rational Rose stream are to be reimported into the Rational Software Architect stream. But this time, the changes from the incoming model must be merged into the Rational Software Architect version of the model that has changed. The fusion feature works well here, because user intervention will be necessary to figure out potential conflicts between changes based on each of these tools

Advanced workflow

It is theoretically possible to maintain multiple product variation streams in a single release. It is also theoretically possible to maintain both stream sets in both Rational Rose and Rational Software Architect while migrating. This is an advanced scenario that would use the import workflow described in this section to take changes from Rational Rose into the Rational Software Architect stream. It might then use the migration scenario to propagate the identities across multiple stream sets.

The actual flow is simple:

  1. After importing the model, rename the model file and check out the existing version.
  2. Then combine models with the newly imported model as the source model and the checked-out model as the target. See the section about Rational Software Architect provides two methods to solve the general problem of models that have similar structures, yet have identities that are not aligned: model fusion and model ID alignment., which follows, for further discussion.

2 of 8 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=551286
TutorialTitle=Comparing and merging UML models in IBM Rational Software Architect: Part 10. Realign your models after migration or transformation
publish-date=10192010
author1-email=kletkema@ca.ibm.com
author1-email-cc=