UML1 Modeling in MyEclipse

1. Modeling with UML1

MyEclipse provides the following UML 1 features:

    • UML Diagrams: Use-case, Class, Sequence, Collaboration, State, Activity, Deployment
    • Integrated Diagram Editor, Outline view, and Properties view
    • UML perspective
    • Free-form figure drawing tools
    • Direct edit of Node and Connection details via Hot-Zones
    • Diagrams stored in UML Model Repository file (e.g., cardemo.umr)
    • No restriction on location or project type that might contain UML Model Repository files
    • Generate Java code from models
    • Export models as XMI 1.0 format
    • Export diagrams in image format: GIF, PNG, PS, EPS, SVG
    • Reverse-engineer class diagrams from any MyEclipse Java EE project or Eclipse Java project
        • Batch process reverse-engineer any combination of project, source-folder, Java package or individual class
        • Drag-n-drop any Java class or interface from the Package Explorer view onto any UML class diagram
        • Customizable reverse-engineering preferences
    • Drag-n-drop any UML artifact from the Outline view onto any compatible UML diagram
    • Auto-layout option for class diagram

Note: The contents of this document refer to the UML1-based feature set in MyEclipse. Please note that there are both UML1 () and UML2 () tooling available in the IDE. Similar documentation of the UML2 features are available in the UML2 overview.

2. UML Perspective

The MyEclipse UML perspective provides a workbench organization tailored to activities of the modeling process. Default views include the UML Diagram editor, Outline view, and custom Properties view. Toolbar actions are added to make new diagram creation quick and simple. When you create a new UML model in a project, you are prompted to open the UML perspective.

UML perspective

3. Getting Started with UML

Getting started with MyEclipse UML begins with the creation of a UML Model Repository file (UMR). After creating the new UMR file, you are taken to the MyEclipse UML perspective.

Creating a new UML model repository file

The MyEclipse UML perspective provides many specialized tools for developing and working with UML diagrams, including:

Support for seven of the most popular kinds of UML diagrams

Available UML diagrams

Easy management of multiple diagrams in the same UMR file

Diagram management

Diagram-specific tool bars that allow you to create and modify your diagrams quickly and easily

Diagram tools

Support for inline editing of elements directly in the diagram

Inline editing

Quick-connect support for elements that support relationships with other elements in a diagram

Quick-connect of related elements

Context-sensitive properties for the elements you are working with directly in your diagram

Context-sensitive element properties

There are many more tools available to you as a UML developer like exporting your diagram to an image so it can be included in documentation, printing or even auto-laying out the contents of the diagram using an advanced layout algorithm.

The MyEclipse UML tools are geared towards an Agile development model, helping you to get up and running quickly either reverse-engineering a project into diagrams to better understand it, or generate source code from a diagram to get started quickly.

4. Forward Engineering

One of the most powerful features of the MyEclipse UML tool set is the ability to forward and reverse engineer code to and from your diagrams. Forward engineering can be accessed when a Class Diagram is being viewed from the UML menu.

Generating code from diagram

During the forward engineering step, you can select the classes you want read out of your project and convert them into a class diagram using the wizard.

Selecting classes to convert to a diagram

The forward engineering step generates not only the classes and interfaces described in your diagram, but also any relationships (e.g. inheritance) specified.

5. Reverse Engineering

In addition to forward engineering, the MyEclipse UML tools also supports reverse engineering, or the ability to read source code out of your project and generate class diagrams from them. This can be helpful when analyzing a new or complex source tree and trying to get a better understanding of how all the parts interact. The reverse engineering process can also be helpful for generating diagrams for documentation purposes.

Reverse engineering can be initiated two ways, one from the UML menu, just as the forward engineering step, and the other way is using drag and drop.

Drag and Drop

Using drag and drop reverse engineering is the easiest mode. You select the classes you want from your package explorer and drop them directly into your diagram. The new diagram is created for you instantly.

UML Drag Start
Drag and drop reverse engineering

Reverse Engineering from the Menu

To access reverse engineering from the menu, select UML>Reverse Engineer UML from Java menu item.

UML Batch Reverse Engineering

Reverse engineering from the menu

Select the elements from your project’s source that you want included in the diagram.

Selecting elements to diagram

Fine-tune the reverse engineering process before continuing.

Reverse engineering options

6. Drawing Tools

Many diagram tools are limited when it comes to usefully describe the diagram to another developer or manager; this is especially true when you are limited by the diagramming tool’s ability to annotate or decorate your diagram with notes or prompts.

The MyEclipse UML tool supports generic drawing tools for the different types of diagrams.

Drawing tools

These free-form drawing tools allow you to annotate any diagram in any fashion you like without effecting the actual layout or meaning of your diagram.

Use of free-form drawing tools