UML - Managing Models



A Unified Modeling Language (UML) model is a simplified representation of a system used to understand and design the system, its components, and their relationships. A model uses different diagrams, elements, or models to describe aspects of the system. The purpose of the model determines the diagrams, models, and elements used.

In the Rational modeling products, all UML models are managed similarly. You state default settings for UML models by specifying preferences. You create and populate models with different diagrams to represent aspects or behaviors of the system.

Customizing Preferences for UML Models

Preferences for UML models change the appearance of a model to enhance the model for viewing or presentation visually.

  • Setting Preferences for UML Models: You can set preferences for UML models to enhance their appearance for viewing or presentation. These preferences include changing element and diagram appearances, creating path variables for directory locations, and controlling automatic return messages in sequence and communication diagrams.
  • Changing the active language projection of a UML model allows you to display domain-specific languages in the diagram.
  • Removing UML model-to-diagram synchronization means that changes to the model wont automatically reflect in the diagram, and vice versa, by setting the canonical property to false.

Creating UML Models

Depending on the complexity of the system or application, you create one model or several models. You can create empty models or use an existing model or model template as a starting point.

From the Modeling perspective, click File > New > Model. In the Model wizard, on the Create Model page, choose Standard template to create the model from a template (including a blank template for an empty model) or choose Existing model to create from a model in your workspace. Click Next.

If using an existing model, select it in the Select a model file field, name the new model, set the location, and click Finish.

If using a template, follow these steps −

  • Select a category under Categories.
  • Pick a template under Templates. For a blank model, choose the General category and Blank Package template. To see hidden templates, check Show All Templates.
  • Name the model and set the location. Click Next.
  • The wizard contains several pages, depending on the template selected. Fill in the required details, such as the default diagram type, associated capabilities, or package type. You may also need to add the model to a working set.
  • Click Finish.

Dividing UML Models into Fragments

UML models can become large and complex, especially in team environments where many people share and edit them. To make working with a large model easier, portions of the model are saved as fragments, which are subunits of the model stored in separate files.

Reducing Workspace Clutter in the Modeling Perspective

From the Modeling perspective, mechanisms reduce workspace clutter and display only the user interface elements or modeling elements that are needed.

  • Capabilities and viewpoints control the tools that are displayed when using the IBM Rational modeling products.
  • You organize workspace contents by sorting and filtering items from the different views.

Organizing UML Models

Various elements are organized in UML models to optimize the model for viewing, printing, or presenting. The following is the procedure for organizing UML models −

  • Add elements to UML models or diagrams
  • Copy or move model elements between models
  • Search for text or model elements in UML models
  • Specify default UML diagrams for packages
  • Organize UML model elements into packages
  • Move UML models between projects
  • Rename UML models without changing file names
  • Link UML model elements to external files
  • Document model elements with detailed information

Exploring UML Models

UML models and their diagrams are searched, browsed, queried, and explored. Specific text is searched and replaced, custom queries are created to browse a diagram, or the inheritance hierarchy of a classifier or its relationships is explored.

Extending the Meaning of UML Model Elements

Stereotypes are applied to model elements to identify their purpose and extend their meaning. Constraints are applied to model elements to identify a condition that a model element must satisfy or a restriction on a model element.

Validating and Repairing UML Models

UML models and diagrams are checked to ensure they meet the constraints defined by the UML. UML models are also checked for compliance with constraints that are defined by other applications.

Saving and Closing UML Models

Changes to a model are indicated by an asterisk (*) beside the model name in the Project Explorer view, indicating unsaved changes. If the model is open in the Model Editor view, or diagrams are open in the diagram editor, an asterisk appears beside the name on each tab. The asterisk disappears after saving the model. A model is modified and saved when associated resources are modified. When the model is closed, saving unsaved changes is prompted.

Importing and Exporting UML Models

Importing and exporting UML models and other resources allows them to be shared within or across teams.

  • UML 2.1 and XMI interchange models are imported as EMX models, or EMX models are exported as UML 2.1 or XMI interchange models.
  • EMX model files and other resources are imported from another workspace or file location or exported to another file location.

Importing Libraries for UML Models

When a new UML model is created, it references the UML Primitive Types model library by default.

Other libraries are imported that are referenced, and the elements that the libraries define are used to set the type for elements and attributes in models.

Creating Model Translation Descriptors

Localized models collect language descriptors and place them in a specific file that is translated into a different language.

Translated models are helpful when clients or developers from different regions need to view or work with models created in a different language.

Upgrading Models and Their Fragments to the Latest Product Version

A model and all its fragments are upgraded to the latest version of the product simultaneously, saving time and memory resources because the model and fragments do not go through the silent migration process each time the model is loaded.

Deleting UML Models

A UML model and its underlying model elements, including diagrams, are deleted from a project.

To delete a model:

  • In the Project Explorer view, click an EMX model file.
  • Click Edit > Delete.
  • In the Confirm Resources Delete window, click Yes.
Advertisements