UML2 Modeling in MyEclipse
1. Modeling with UML2
MyEclipse provides the following UML 2 features:
- UML 2 Diagrams: Class, Component, Deployment, Composite Structures, Use-case, Activity, Sequence, State Machine, Profile
- Integrated Diagram Editor, Outline view, and Properties view
- UML perspective
- Direct edit of Node via Hot-Zones
- Diagrams stored in UML2 model diagram (.umldi) file
- No restriction on location or project type that might contain UML model 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 - Drag-n-drop any UML artifact from the Outline view onto any compatible UML diagram
- Auto-layout option for class diagram
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
2. UML2 Graphical Diagram Editor
The UML 2 editor allows you to create and edit nine different types of UML 2 diagrams.
List of UML 2 diagram types
Class diagram
Component diagram
Deployment diagram
Composite Structure diagram
Use Case diagram
Activity diagram
Sequence diagram
State Machine diagram
Profile diagram
3. Outline View
Use the outline view to easily navigate the diagram, graphically or structurally.
Outline view
Selecting an existing element allows you to further modify it in a tabbed property view. A few properties are shown below.
Advanced properties
The UML 2 editor toolbar contains all the features you need to create visually appealing diagrams.
UML 2 editor tools
To automatically layout class diagrams, select UML2>Auto Layout from the menu.
Auto layout of class and use-case diagrams
Further control is possible through an element’s right-click context menu and the Graphics tab in the Properties view.
Graphics Property tab
Use the UML 2 preferences to specify the default styling for UML 2 entities.
UML 2 preferences
4. Getting Started with UML2 Models and Diagrams
Click the UML2 icon to create a new UML2 model and diagram file. Alternatively, you can select File>New>Other from the menu, expand MyEclipse>UML, and select UML2 Model.
Creating a new UML2 model
To reverse engineer an existing Java project into a UML2 model and class diagram, right-click the project and select MyEclipse>Generate UML2 Class Diagram from the menu.
Reverse engineering a project into a UML2 model and class diagram
You can also import a Rational EMX file by selecting File>Import from the menu, expanding UML2, and selecting Rational EMX File.
Importing a Rational EMX file
XMI files can be imported to give you a UML2 model file. Select File>Import from the menu, expand UML2, and select XMI 2.1.
Importing XMI 2.1 file
5. Generating Code & Other Resources
Generating Java
Select UML2>Generate Java from the menu to generate Java into your current project.
Generating Java
Generation actions are also available from the right-click context menu of a UML model (.uml) file.
Right-click context menu of a model file
You might be prompted for details on how specific changes should be merged with your existing code base.
Exporting an XML Schema (XSD) files
Select UML2>Export XML Schema from the menu to generate an XSD file corresponding to the selected UML2 model.
Exporting XMI files
Select UML2>Export XMI 2.1 from the menu to create an XMI file from a given UML2 model.
Exporting a model to an XMI file