Professional Documents
Culture Documents
version 9.5
No Magic, Inc.
April, 2005
CONTENTS
CONTENTS 2
1 INTRODUCING MAGICDRAW
1-12
2 GETTING STARTED
2-20
Updating 2-22
2-23
3-44
3-44
3-45
Loading 3-50
Project Options. Style Engine 3-51
Profiles
3-74
3-75
3-83
3-95
Searching 3-99
3-104
3-109
Resources Manager
3-112
3-114
4 DIAGRAMS BASICS
4-120
Laying out
4-153
Zooming 4-162
Using Grid 4-163
Assigning Shortcut Keys 4-164
Printing 4-165
Print Range tab
4-165
5 UML DIAGRAMS
System Views
5-174
5-175
Usage 5-229
Merge 5-229
Import 5-229
Containment 5-230
5-230
Collaboration Diagram
5-242
Sequence Diagram
5-265
5-323
Stereotype 5-323
Stereotype Specification dialog box 5-324
Profiles dialog box, Stereotypes tab 5-326
UML Web Extension stereotypes 5-327
Tag definitions 5-334
Tag Definition Specification dialog box 5-335
Tagged Value Specification dialog box 5-336
Profiles dialog box, Tag Definitions tab 5-337
TODO item 5-339
Groups 5-339
Constraints 5-339
Constraint Specification dialog box 5-341
Profiles dialog box, constraints tab 5-342
6 EXTENSION DIAGRAMS
6-358
Robustness Diagram
6-360
6-363
6-364
6-367
6-371
6-375
6-377
Time Diagram
6-382
7 TOOLS
Reports
6-372
6-380
6-383
7-386
7-386
Metrics 7-449
INDEX 464
10
INTRODUCING MAGICDRAW
Todays graphical software can be extremely complex in its structure and architecture,
but that does not mean it must be difficult to use. We have learned much from the
hardware industry, where everything you see is scattered pieces. This approach also
works well in the software world objects at a higher abstraction level are treated like
software pieces. To simplify the process further, we may use pictures instead of textual
descriptions to show the relationships between objects in a complex system. Though
pictures work better than textual descriptions alone, experience has proven that
communicating complex ideas effectively requires more than simple flowcharts.
Early methodologies, such as Booch notation, OMT, and others, served the same
purpose: to graphically express the softwares architecture information. However, these
methodologies accomplished this in slightly different ways and with different levels of
thoroughness. In 1994, Grady Booch, Jim Raumbaugh, and Ivar Jacobson came
together to unify their varied methods and experience. The UML (Unified Modeling
Language) was the fruit of their joint effort. UML was crafted with two objectives: To
reflect the best practices of the industry, and to demystify the process of software system
modeling.
In short, UML provides standardized pictures of your software applications and allows
your development team to quickly grasp the functionality contained within the
application. UML is a language and a process with neutral notation, which means that
you may use it to design your entire OO system in any programming language and any
software development process.
The development of a model for an industrial-strength software system, prior to its
construction or renovation, is as essential as having a blueprint for a large building.
Good models are vital for effective communication among project teams.
In the early 1990s, the tools for OO software modeling emerged, followed by the
development of the visual modeling approach. Visual modeling means that you first
design your system by drawing diagrams (blueprints) and then employ tools to convert
those diagrams into code. The value of such an approach is that the often tedious
framework coding is done automatically, freeing the programmer to focus on design
issues, plus, the transition from the design to the implementation phase is smoother more
and straightforward. Moreover, using the features of reverse engineering and code
generation, the developer may move back and forth between the code and the design
that is expressed in the diagrams.
Today, visual modeling tools provide many features that replace some of the more
tedious tasks for the designer, programmer, and documentation writer. Some of the
leading tools provide so-called code round-trip engineering capabilities the structure of
reverse engineered code is changed in the modeling tool and is generated back without
the implementation of specific information (e.g. method bodies, comments) loss.
1-12
INTRODUCING MAGICDRAW
MagicDraw Editions and Features
MagicDraw is a visual UML modeling and CASE tool with teamwork support. Designed for
Business Analysts, Software Analysts, Programmers, QA Engineers, and Documentation
Writers, this dynamic and versatile development tool facilitates analysis and design of
Object Oriented (OO) systems and databases. It provides the industry's best code
engineering mechanism (with full round-trip support for Java, C#, C++, WSDL, XML
Schema, and CORBA IDL programming languages), as well as database schema
modeling, DDL generation and reverse engineering facilities.
1-13
Java version - Code engineering for Java, Java bytecode. Integration with Java
IDEs.
INTRODUCING MAGICDRAW
MagicDraw Documentation and Support
The Professional Edition is ideal for anyone who wants to generate code out of an existing
model or create a UML model from an existing project.
MAGICDRAW ENTERPRISE EDITION
The MagicDraw Enterprise Edition represents the top of the line of the MagicDraw family of
products and represents the ultimate solution for all your modeling needs. The Enterprise
Edition combines all of the functionality of the Personal and Standard Editions, and all three
versions of the Professional Edition, into a comprehensive state-of-the-art UML
programming solution. But the Enterprise Edition does not stop there and adds code
engineering and diagramming functionality in CORBA IDL, EJB, WSDL and XML schema.
For working with DB structure, the Enterprise Edition not only provides code engineering
and diagramming but also provides structure retrieval via JDBC.
The MagicDraw Enterprise Edition is a must when working with multiple development
technologies and databases.
The MagicDraw family of award-winning products represents the most powerful and best
value in the UML modeling industry today.
MAGICDRAW READER EDITION
MagicDraw Reader edition is made for reading and previewing UML models created with
MagicDraw and is free of charge. It is extremely useful when you want to share your ideas
expressed in UML with partners, colleagues, or clients, who do not have their copy of
MagicDraw. This edition is also equipped with printing and image export capabilities.
MAGICDRAW COMMUNITY EDITION
MagicDraw Community edition is a free edition for developers working on non-commercial
projects. It has a minimal functionality set and only class diagram has no limitations. Other
diagrams allows saving a project with 25 use cases, 25 states, 25 classifier roles, 25 action
states, 25 instances, 25 nodes, and 25 components.
MagicDraw Community edition is designed for creating static structure models, when XMI
output is needed and is ideally suited for Open Source projects.
This edition is also equipped with printing and image export capabilities.
1-14
INTRODUCING MAGICDRAW
MagicDraw Documentation and Support
Help
Integrated in the MagicDraw help is based on JavaHelp. MagicDraw help provides
detailed description of all MagicDraw dialog boxes, commands, shortcut menus, also
you will find their a How to.. list, main descriptions and examples of all UML model
elements.
U s e r s G u i d e s
Name
Description
Location
MagicDraw
UserManual.pdf
Includes detailed
explanations and
instructions of installing and
working with MagicDraw.
1-15
<MagicDraw installation
directory>/manual
Start/Programs/MagicDraw
UML/MagicDraw User
Manual.pdf
www.magicdraw.com ->
Download->Download
Manual
INTRODUCING MAGICDRAW
MagicDraw Documentation and Support
Name
Description
Location
MagicDraw
CodeEngineering
UserGuide.pdf
MagicDraw Tutorials
UserGuide.pdf
MagicDraw Integrations
UserGuide.pdf
MagicDraw
FloatingLicense
UserGuide.pdf
MagicDraw Teamwork
UserGuide.pdf
MagicDraw OpenAPI
UserGuide.pdf
<MagicDraw installation
directory>/manual
www.magicdraw.com ->
Download->Download
Manual
<MagicDraw installation
directory>/openapi/docs
OTHER DOCUMENTATION
Readme files. In the main MagicDraw installation directory, the main
readme.html file is located. Also readme documents are available for
MagicDraw integrations.
1-16
INTRODUCING MAGICDRAW
MagicDraw Documentation and Support
Notes. In the notes.html file you will find the main information about MagicDraw
features.
Support
FAQ
Before you call or write an email, look into our FAQ (Frequently Asked Questions) list. It is
constantly updated and perhaps it contains an answer to your question.
NEWSGROUPS
Discuss and get answers about MagicDraw in newsgroups.
E-MAIL
We provide a professional e-mail support for registered MagicDraw users.
support@magicdraw.com - private questions about product installation, and more.
sales@magicdraw.com - questions regarding academic and site discounts, quotes.
contact@magicdraw.com - e-mail for other contacts.
Get an answer in 24 hours!
BUG REPORTS
Submit notifications of software errors by submitting a bug directly from MagicDraw
application (Help menu->Submit a Bug) or by sending an email to bugs@magicdraw.com.
These reports help us address defects in a more timely manner, as well as speed up the
release of maintenance releases free of known defects.
When sending your report by email, please include (if applicable):
MagicDraw UML version number and name of the edition (Reader, Community,
Personal, Standard, Enterprise, Professional Java, Professional C++,
Professional C#, Demo, or Academic).
Source where you got the version from (demo CD, our homepage download).
CLASSPATH settings.
If you don't have this information, you can find it by opening the About dialog from
MagicDraw Help menu. If MagicDraw is unable to load your file, and the file is nonconfidential, please attach it to your submission.
This will assist us in our analysis of your problem.
1-17
GETTING STARTED
S y s t e m r e q u i r e m e nt s
To run MagicDraw UML, your system must meet the following requirements:
Resource type
Minimum
Recommended
CPU
Pentium 4 1600
Memory
256 MB
512MB; 1GB is
recommended for larger
projects
Disk space
200 MB
200 MB or more
Video mode
Operation system
HTML browser
Any
Netscape Navigator or IE
Java Virtual
Machine (JVM)
JDK 1.4
2-20
GETTING STARTED
Installing and Running
Sun (JDK standard) for Solaris and Linux. JDK 1.4.2_03 is recommended, JDK
1.5 is supported.
Sun (JDK standard) for Windows (2000, NT, 95/98). JDK 1.4.2_03 is
recommended, JDK 1.5 is supported.
Installation procedure
First, obtain the MagicDraw installation files. You may download the latest version from the
MagicDraw homepage (http://www.magicdraw.com/.) Because MagicDraw is a Java
application, you will need more than the installation files to run the tool successfully. You
may also install JVM together with MagicDraw or you may have it already installed.
Information about the latest Java ports is available at
http://www.magicdraw.com/jvm_list.htm.
NOTE
If an installation is for Windows, and has a JVM you don't need anything else.
WINDOWS 2000/9X/NT/XP
After downloading, double-click MD_UML_95_win.exe (for the Personal Edition
MD_UML_95_PE_win.exe).
The Setup Wizard automatically adds MagicDraw UML shortcuts to the start menu and the
desktop. You may also execute the shortcuts from the installation directory.
2-21
GETTING STARTED
Updating
UNIX
After downloading, open a shell and go to the directory where you downloaded the
installer.
At the prompt type: sh ./MD_UML_95_unix.sh (for the Personal Edition
MD_UML_95_PE_unix.sh).
MAC OS X
After downloading, double-click MD_UML_95_mac.dmg (for the Personal Edition
MD_UML_95_PE_mac.dmg) and install application by dropping launcher to the
Applications folder (or somewhere else).
Requires Mac OS X 10.3 (Panther) and Java 1.4.2.
ALL OTHER PLATFORMS INSTRUCTIONS (NO INSTALL VERSION)
Download MD_UML_95_no_install.zip (for the Personal Edition
MD_UML_95_PE_no_install.zip).
After downloading, extract the contents of the zip. These files require some modifications
prior to launching them.
On Windows platform:
UPDATING
Automatic updates feature is implemented in MagicDraw. Notification and update of all the
patches can be done automatically.
NOTE
2-22
GETTING STARTED
structure of menus and toolbars
Function
Check
Cancel
Help
Accessibility
Main operations of
editing (copy, cut,
paste, delete)
Edit menu.
Main toolbar buttons.
Shortcut keys.
Shortcut menu commands from Browser.
Opening of
Specification dialog
boxes
Defining symbols
properties (font,
color, etc.)
NOTES
2-23
GETTING STARTED
Setting Personal Preferences
Environment Options
You may customize MagicDraw according to your preferences: Change the application
settings of your project in the Environment Options dialog box.
OK
Cancel
Help
2-24
GETTING STARTED
Setting Personal Preferences
GENERAL
PANE
Change the appropriate fields according to your preferences. If the check box is
selected, the description False changes into True.
2-25
Property name
Function
GETTING STARTED
Setting Personal Preferences
Property name
Function
Help font
The default Help server port is 1111. Change it, if some other
server is started on this port.
Icon size
Select the size of the icons on the toolbar. The possible choices
of icon sizes are 32 and 24.
Enter the system idle time (in minutes) when to activate file
recovery save.
Language
The project you have finished the last session will be opened
next time you start MagicDraw UML.
Type the number of recently used windows that are listed in the
Window menu. Click the window name to make it active. The
maximum windows list size is 10.
Save diagram
background in image
Show font face in font list Font names that are listed in the Font drop-down list box on the
main toolbar will be displayed in the original font.
2-26
GETTING STARTED
Setting Personal Preferences
Property name
Function
Show hyperlinks in
specification dialog
Shows the project memory usage line in the bottom of the Magic
Draw window.
Shows status bar line in the bottom of the Magic Draw window.
Shows the Tips of the Day dialog box every time you start the
tool.
2-27
GETTING STARTED
Setting Personal Preferences
DIAGRAM
PANE
Property name
Function
Graphics antialiasing
Grid style
Select one of the following style of the grid: Dense and Sparse.
2-28
GETTING STARTED
Setting Personal Preferences
Property name
Function
Optimize paths
Show manipulation
highlighting
Text antialiasing
BROWSER
Type in the step value of zooming your diagram views. Step value
should be in range from 0.1 to 1.0.
PANE
Property name
2-29
Function
GETTING STARTED
Setting Personal Preferences
Property name
Function
Browser position
In the drop-down list, select the Left if you wish the browser to
appear in the left side of the workspace. Select the Right if you
wish the browser to appear on the right side of the workspace.
Group by base class Groups stereotypes, tagged values and constraints by base class
in the in the Model Extensions Tree.
Group by diagram
type
Group by profiles
Show changes in
browser
Show code
engineering sets
Show diagram zoom Shows zoom slider in the Zoom Control tab.
slider
Show full types in
browser
Show hyperlinks in
browser
Show stereotypes in
browser
Sort always
2-30
GETTING STARTED
Setting Personal Preferences
TEAMWORK
PANE
2-31
Property name
Function
Auto login to
server
Teamwork server
name
Show commit
warning
Show modules
versions conflict
warning
The warning appears when two modules (or module and a project)
use the same submodules.
GETTING STARTED
Setting Personal Preferences
FLOATING PANE
This pane is available only if you use MagicDraw Floating License.
Property name
Function
Floating license
server name
Floating license
server port
Enter the port number of the Floating License Server. The server may
be started on many different ports.
Auto login to
floating license
server
2-32
GETTING STARTED
Setting Personal Preferences
CVS
PANE
2-33
Property name
Function
Add project to
CVS after saving
Every time adds a newly created project in the checked out directory
to CVS. The Add Project to CVS dialog box appears.
Commit project to
CVS after saving
Updates the project that is added to CVS while loading. The Update
CVS Project dialog box appears.
Update project
from CVS before
loading
Commits project to CVS after saving it. The Commit Project to CVS
dialog box appears.
Location of
.cvspass
The path where the .cvspass is located. You may type it or choose
the path from the Open dialog box.
Local folder
The path where the module will be saved on checkout action. You
may type it or choose the path from the Open dialog box.
GETTING STARTED
Setting Personal Preferences
UPDATE
PANE
Property name
Function
Show auto-checking
confirmation dialog
box
2-34
GETTING STARTED
Setting Personal Preferences
HTTP PROXY
PANE
2-35
Property name
Function
Type the port of the HTTP Proxy Server. The default number is
8080.
Authenticate HTTP
proxy server
GETTING STARTED
Setting Personal Preferences
KEYBOARD
PANE
Property name
Function
Category
The list of all available categories of the keys (File, Edit, Tools, etc.). The
default item in this choice is always All Categories. Selecting the category
opens its context in the Commands list.
Commands
Current keys
Press new
shortcut key
The field for entering the new key. Puts a human representation of any key
pressed in the field. If the pressed key is already assigned to other
command, the Currently Assigned To label with this command name
appears.
Currently
assigned to
Shows the name of the command of the entered new key if this key is
already assigned to some command. By default is hidden. This label is
visible just if entered key is already assigned to some command.
Assign
Assigns the entered key to the selected command. The entered key is added
to the Current Keys list.
2-36
GETTING STARTED
Setting Personal Preferences
Property name
Function
Remove
Remove All
PLUGINS
PANE
2-37
Property name
Function
Name
Provider
Version
Loaded
Enabled
Shows the status of the plugin. If True, the selected plugin is activated in
MagicDraw.
Disable/Enable
GETTING STARTED
Setting Personal Preferences
RESOURCES PANE
Displays the external resources such as dtd, xsd, etc. that are used in MagicDraw.
Property name
Function
URI
Edit
Edit the location and the URI of the resource in the External
Resource dialog box.
Add
Remove
Edit
2-38
GETTING STARTED
Setting Personal Preferences
Property name
Function
Add
Remove
2-39
GETTING STARTED
Setting Personal Preferences
LAUNCHER PANE
Property name
Function
Default Launcher
Default Browser
Defined Launchers
Edit
Add
Remove
Reset to Defaults
OK
Cancel
Help
Loo k a n d Fe e l : C o n t r o l l i n g I n t e r f a c e
The appearance of MagicDraw UML windows, dialog boxes, menus, and everything inside
them can be changed.
2-40
GETTING STARTED
Setting Personal Preferences
Theme
Description
Metal
CDE/Motif
Windows
Kunststoff
The chosen style will not look exactly like the applications in those operating systems
because every style of graphical interface is implemented within a Swing library, but it will
look quite similar. Depending on which operating system you use, some choices might be
unavailable to you. For example, Windows9x/NT users may not switch to the Mac interface
style.
Look and Feel Themes themes listed in Look and Feel Themes subcommands are valid
only for the metal style. Choose from any of the following themes:
2-41
Aqua
Contrast
Big Contrast
Green
MagicDraw
Big MagicDraw
GETTING STARTED
Setting Personal Preferences
Khaki
Kunststoff Theme
2-42
The term project is used to describe the problem that must be solved, including all the
possible solutions for how the problem can be resolved and finally developed. All works in
MagicDrawTM UML are organized into projects. Project is a top one entity where all modelrelated data (the set of diagrams) is held. Project data is organized by object orientation,
which makes its management intuitive and in accordance with the problem that is being
solved.
In this Section, you will find the following chapters:
1 "Creating New Project ", on page 44
2 "Saving and Exporting", on page 46
3 "Loading", on page 50
4 "Project Options. Style Engine", on page 51
5 "Modules Functionality. Reusing project part - Partitioning", on page 63
6 "Profiles", on page 74
7 "Model Differencing", on page 76
8 "Working with multiple projects", on page 83
9 "Using Browser", on page 84
10"Searching", on page 99
11"MagicDraw and Rational Rose", on page 104
12"MagicDraw and Together ControlCenter", on page 109
13"Resources Manager", on page 114
Component View package contains components that are created during the
code engineering and represent source files. Adding a resident element to a
particular component causes that element to be generated within the source file.
MagicDraw Profile contains tagged values and stereotypes that are necessary for
working with various parts of MagicDraw.
UML Standard Profile contains primitive data types, constraints, tagged values,
and stereotypes, which are UML standard and can be used in various cases. The
3-44
WO R K I N G W I T H P R O J E C T S
Creating New Project
following data types are specified in Magic Draw: boolean, byte, char, double,
float, int, integer, long, short, and void.
You may also create your own packages for holding the model elements, but, by default,
packages may not be deleted or renamed in a project (except for the Component View
package).
To start a new project, you must create a new workspace for it.
In all cases, you receive a new project named UntitledN, and it is selected as an
active project.
3-45
WO R K I N G W I T H P R O J E C T S
Saving and Exporting
The newly created project from template will contain specific model elements and
stereotypes.
TIP!
Importing project
To import an already created project to an opened project
1 From the File menu, choose Import.
2 The Import dialog box appears. Choose the project you want to import and
click OK. The diagrams of the imported project are placed in the opened one.
3-46
WO R K I N G W I T H P R O J E C T S
Saving and Exporting
To save changes for the later sessions, revised projects must be saved. While saving, you
may edit the changeable name of the project and the file format.
click the Save button on the main toolbar, or press shortcut keys CTRL+S. The
Save dialog box appears.
2 Select the destination directory (where you wish to save the project) and type the
file name for it.
3 Choose the format for saving a project: Packed XML (*xml.zip) (default) or
Extensible Markup Language (*.xml)
4 Choose the version of XMI - 1.0, 1.1, or 1.2. Also if you want to save maximum
additional information to xmi file, which is not required on Magic Draw load but
may be useful using other tools, select Rich XMI button.
NOTE
If the Create Backup File check box is selected in the Environment Options dialog
box, MagicDraw always creates a backup file that has the previously saved
project. The backup is held in a file with a name identical to that of the project.
For a detailed description of the Environment Options dialog box, see Section
Setting Personal Preferences on page 2-24.
3-47
WO R K I N G W I T H P R O J E C T S
Saving and Exporting
Box
Function
Template Name
Description
OK
Cancel
Help
3-48
WO R K I N G W I T H P R O J E C T S
Saving and Exporting
To save the current diagram, or the selected element, within the diagram as an image
1 From the File menu, choose Save As Image. The Save As Image dialog box
appears.
2 Select the Active Diagram or the Selected Symbols option button.
3 Select the file format (*.svg, *.eps, *.dxf, *.wmf, *.png, *.jpg, *.emf), file name,
and the location directory.
The filename of the saved diagram will be the same as the name of that diagram.
3-49
WO R K I N G W I T H P R O J E C T S
Loading
The Not Empty Diagrams list contains all exportable diagrams that contain UML elements.
Empty diagrams are not displayed, select the diagrams you wish to export:
To display in the list all diagrams that are available in the project
Click the Load All Diagrams button in the Save As Image dialog box.
Autosave
After you stop working with MD, an idle time passes and the current project is saved to a
special file - AutoRecovery file.
If application is terminated normally, AutoRecovery file is removed. If application crashes,
AutoRecovery file is left. On startup, MagicDraw checks for AutoRecovery file, if it exists,
suggests to load a project from this file.
To save AutoRecovery file of the opened project(s) when a system is not in use.
1 Open the Environment Options dialog box.
2 In the General pane, select the Save Project Recovery Data on Idle check box.
Also enter the system idle time (in minutes) when to activate file recovery save
in the Idle Time to Activate Recovery Save text box.
LOADING
IMPORTANT! Beginning with MagicDraw Version 3.6, the native MagicDraw format is .xml.
TIP:
NOTES:
2005 No Magic, Inc
3-50
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
If the Open Last Project on Startup check box in the Environment Options dialog
box is selected, the last project you worked with will be opened right after
MagicDraw starts.
XMI v1.0, v 1.1 and v1.2 are native MagicDraw file formats for model storage.
But these formats do not specify how to store diagrams. So if you use MagicDraw
to open the XMI file, exported with another tool, only the model will be loaded
(diagrams, views not). MagicDraw can not "import" such XMI, it can only open it.
For model interchange you should use the Unisys XMI 1.0. If your tool does not
support Unisys XMI 1.0, you will not be able fully (with diagrams) exchange the
model. More about interchange with Rational Rose ant Together ControlCenter,
see in Section MagicDraw and Rational Rose on page 3-104 and Section
MagicDraw and Together ControlCenter on page 3-109.
You may load more than one project within the same MagicDraw session. Separate
workspace will be created for each project that is opened.
Pr o j e c t O p t i o n s
The Project Options dialog box is used for defining properties for model elements (shapes
and paths) and diagrams, for creating your own project style, importing or exporting the
created project style, and defining code engineering options.
3-51
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
The Project Options dialog box has several collections of customizable options:
General Project
Options
Diagram Info
Symbols Properties
Styles
Code Engineering
To find elements to change, browse the options tree in the Project Options dialog box. The
items in this hierarchy are either:
Compressed - a plus sign next to an icon indicates that the icon is compressed,
and contains other model elements. This is the default setting when you start
3-52
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
your application. Click the plus sign to expand the icon and view its subordinate
items.
Expanded - a minus sign next to an icon indicates that the icon is fully
expanded. Click the minus sign to collapse the item.
If there is no sign next to an icon, it does not contain other model elements.
The following buttons are available in the Project Options dialog box:
Button name
Function
Clone
Rename
Change the name of all existing style. Type a new name for
a style in the Enter Style Name dialog box.
Delete
Make Default
Make the selected style as your default style for the newly
created projects.
Apply
Import
The Open dialog box appears. Select the style you wish to
import (*.stl).
Export
Reset to Defaults
To make a selected style your default style for newly created projects
Click the Make Default button in the Project Options dialog box.
NOTE:
3-53
Click the Apply button in the Project Options dialog box, Styles pane.
You may also apply the desired options to the selected diagrams model
elements. Click the Apply button in the specific elements pane.
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
To save the created style (export) for a later usage or for other users
Click the Export button. The Save dialog box appears. Select the directory where
you wish to export a style.
SYMBOLS PROPERTIES STYLES TREE
Expands the tree hierarchy of all the styles defined within the project. You may use as many
of these styles as you wish.
Shape and Paths trees have the inner structure to help you find the model element, the
representation of which must be changed. The right side of the dialog box contains possible
choices and instruments to manage them.
3-54
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
In the following table you may find all possible options that can be set for the symbols:
Property
Fill Color
The fill color of the symbol. The Color dialog box appears.
Uses the fill color and symbols are colored on the diagram.
Pen Color
The pen color that is used to draw elements. The Color dialog
box appears.
Text Color
The color that is used for text coloring. The Color dialog box
appears.
Font
Autosize
The end of the path is connected to the fixed point of the shape.
Path Style
Attribute Color
The color of the attribute name. The Color dialog box appears.
Attribute Font
Font that is used for a name of the attribute. The Font dialog box
appears.
Direction
Header Position
Header in Bold
HTML Text
Activates HTML editor for the text of a note and a text box.
Line Style
Operation Color
Operation Font
Font that is used for a name of the operation. The Font dialog
box appears.
Orientation
3-55
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
Property
Show Classifier
Show More Sign for Attributes Shows additional information sign in the class, artifact
attributes list, when omissions are made by editing class
compartment.
Show More Sign for
Operations
Show Multiplicity
Show Name
Show Owner
Show Predecessors
Show Visibility
3-56
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
Property
Stereotype Color
Stereotype Font
The font that will be used to draw stereotypes. The Font dialog
box appears.
Show Stereotypes
Show Constraints
Show Tagged Values
Suppress Actions
Suppress Attributes
Suppress Content
The color of the extension point name. The Color dialog box
appears.
Font that is used for a name of the extension point. The Font
dialog box appears.
The color of the enumeration literal name. The Color dialog box
appears.
Font that is used for a name of the enumeration literal. The Font
dialog box appears.
Suppress Operations
Text Position
Wrap Words
Background Color
Grid Size
Show Grid
3-57
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
Wo r k i n g w i t h Pr o p e r t i e s S t y l e s
All symbols in MagicDraw UML are created according to active properties style. There may
be more than one properties style in the same project, and the whole style may be applied
for the project.
Every style has its own presentation of Diagram, Shape, Path, and Stereotype that you may
modify using the Project Options dialog box in the Symbols Properties Styles branch. You
may set your own options for every model element to the current style.
Paths, Shapes, and Stereotypes branches have the inner structure that helps you find the
model element, the representation of which must be changed. The section on the right side
of the dialog box contains possible choices and instruments to manage them.
The following properties are defined for the formatting symbols:
Shapes. Set general options for the shapes in the right pane of the Project
Options dialog box. You may set such options for all shapes that appear on the
Diagram pane.
Paths. Set general options for the paths in the right pane of the Project Options
dialog box. You may set options for all paths that appear on the Diagram pane.
Stereotypes. Set general options for the stereotypes in the right pane of the
Project Options dialog box. You may set options for all stereotypes that may be
applied to elements on the Diagram pane.
branch, select the specific element (shape, path, diagram, or stereotype) and
right click the mouse button. The list of diagrams in which element symbol may
be created, appears.
3-58
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
2 Select the diagram type. Diagram is added as additional branch to the section.
3 Set the style properties for the element in the right pane of the Project Options
dialog box. Properties will be applied only in the specified type of diagram.
Element may be extended by diagram in the Project Options dialog box, specific
elements pane, clicking the Extend by Diagram button. The Extend by Diagram
dialog box appears. Click the Add Diagram button and select a diagram from
the list.
Select extended diagram and on the right click mouse button, choose Remove.
In the Project Options dialog box, extended diagram style properties pane, click
the Remove button.
PROPERTIES INHERITANCE
All element properties have inherited check box. This check box indicates if property is
derived from the base element properties, or is it specific.
3-59
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
The Inherited column check box value in the elements properties pane specifies if current
property is synchronized with its parent property. When the Inherited value is true,
elements property is changed after changing the parent property.
If property has no correspondent property in upper (parent) level, the Inherited column
check box is cleared and disabled.
If property is modified for the specific element and value differs from the upper level current
property value, the Inherited column check box is cleared automatically.
GENERAL STYLE PROPERTIES
You may define the common properties for the whole style. The style properties are
displayed when properties style is selected in the Project Options dialog box styles tree.
SHAPES, PATHS AND DIAGRAMS PROPERTIES
All shapes, paths and diagrams that may be created in the project, are listed in the Project
Options dialog box. If the Shapes, Paths or Diagrams branches are selected in the tree, the
general properties may be set in the right pane of this dialog box.
When expanding any of these branches, the style for concrete element (diagram) may be
created.
Apply button. The Select Diagrams dialog box appears. The list of diagrams,
which were created in the project, is displayed.
3-60
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
2 Select diagrams in which element properties will be applied and click OK. The
3 Choose which properties will be applied to element symbol from the All to
NOTE!
STEREOTYPES PROPERTIES
Stereotypes properties may be applied only if stereotype properties style is created in the
Project Options dialog box.
Stereotype properties are derived from their base class. Stereotype base class is defined in
the label of the right pane of the Project Options dialog box.
The same element may have several stereotypes assigned. In this case, style of the first
stereotype will be applied to the element symbol. If stereotype is removed from the element,
the next (first) stereotype properties are applied. If the last stereotype is removed from the
element, the base class (shape or path) properties are applied to the element symbol.
Stereotypes may be extended by diagram.
All stereotypes that have defined symbol properties are included into the Stereotypes
branch. By default only boundary, control, and entity stereotypes are added to the tree
when expanding the Stereotypes branch and default style is created for these stereotypes.
3-61
WO R K I N G W I T H P R O J E C T S
Project Options. Style Engine
2 Select the check box near the stereotype and click the Apply button. Stereotype
will be included into the Stereotypes branch. Set the stereotype style properties
in the right pane of the Project Options dialog box.
To apply stereotype properties for already created symbol with assigned stereotype
1 When stereotype style properties in the right pane of the Project Options dialog
NOTE!
box are changed, click the Apply button. The Select Diagrams dialog box
appears.
2 Select diagrams in which stereotype properties will be applied and click OK.
3 In the Select Properties to Apply dialog box, choose which properties will be
applied to stereotype. Click OK.
You may apply stereotype properties to symbol after changing style properties and
in the Project Options dialog box clicking OK. Style will be applied when
selecting symbol on the diagram pane and from the main toolbar clicking the
Apply Default Symbol Style button.
3-62
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
In the Environment Options dialog box, Diagrams tab, the Apply Stereotype Style
for All Symbols check box should be selected and in the Project Options dialog
box, the style properties should be changed for stereotype.
1 In the created diagram, draw an element.
2 From the element shortcut menu, choose Stereotype. The list of available
stereotypes appears.
3 Select the check box near the stereotype you want to assign to element. Click
Apply. Stereotype properties are applied automatically when assigning
stereotype to element.
M O D U L E S F U N C T IO N A L I T Y . R E U S I N G P R O J E C T P A R T
- PARTITIONING
Partitioning functionality it is the segmentation of the MagicDraw project into multiple
independent parts, called modules. This functionality is based on referencing. These
modules are saved using the same file format, as do regular MagicDraw projects, so the
modules can be opened and edited in any MagicDraw client application. This approach
allows easy reuse of the same basic model libraries in multiple projects.
Wo r k i n g w i t h m o d u l e s
EXPORTING PROJECT MODULE
The export module action saves the content of the selected package into a separate file.
Exporting module is the only way to create a module. The package and all the containing
elements after exporting have a readonly status. The module name is displayed in the
brackets near the package name in the Browser tree.
3-63
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
2 In the All Data list, select the package, which you want to be saved as a
separate module. Click the Add button. The package will be placed to the
Selected Objects list.
3 If desired, type the description of the module, which will be displayed in as the
documentation of the package.
4 Click OK. The Save dialog box appears.
5 Select the destination directory, where you wish to save the project module, type
the file name, choose the format for saving and click OK.
3-64
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
4 If desired, type the description of the module, which will be displayed in as the
NOTE:
There is another way to change modules content and make inner elements
editable use the Open Module As Project command. A module will be opened
as a separate project.
SHARING PACKAGES
Since MagicDraw version 8.0, a new concept of shared packages is presented. Module
editing limitations now are removed and if module is opened as a project, it is treated as
regular MagicDraw project only includes shared packages.
Packages can be shared only if they are not dependent on other model (the same principle
as now in "export module"). If project has shared packages, dependencies should be
checked on every saving.
Every project that has "shared packages" can be used in other projects as a module. When
opening it as a module, only shared packages will be loaded from this project file and used
"read only", other packages and all project related information remains not loaded. If there
are no shared packages, this project can't be used as a module.
3-65
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
To share a package
1 Create package. Select it in the Browser. Invoke model element shortcut menu,
select the Modules command and then the Shared Packages command. The
Shared Packages dialog box appears.
2 In the Shared Packages dialog box, the Selected Objects tree, package you
want to share is selected. Click OK. If package doesn't have dependencies with
not shared packages, it is shared.
After package is shared, in the Browser, next to the shared package name appears word
[shared].
TIP
dialog box. In the Shared Packages dialog box, the Selected Objects tree,
packages you want to share are selected.
2 In the Shared Packages dialog box, you may add packages you want to share.
To do this, in the All Data tree, select packages you want share and click the
Add button. Click Ok button.
Not only package can be shared, but model and subsystem too.
3-66
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
choose the Modules command and then the Shared Packages command. The
Shared Packages dialog box appears.
2 In the Shared Packages dialog box, the Selected Objects tree are listed shared
packages. So, in the Selected Objects tree, select the package or packages you
want to unshare, and click Remove. If you want to unshare all shared packages,
click on the Remove All button.
Restrictions of shared packages usage
Actions which are not allowed with shared packages:
Shared package can not include module. This is so, because shared package is
module itself.
For example, draw parent package p1 and package inside it p2. Invoke the
Shared Packages dialog box. To the Selected Objects list add the p1 package.
In the All Data tree, select the p2 package. Message appears: p2 parent
package p1 is already selected.
If you will move shared package p1 to other shared package p2, [shared] words
removes from p2 package, because parent package is shared. Move p2
package from p1 package, next to the package name [shared] is written again.
3-67
If the module is opened as a project, use the Save command to save the
changes, made in this module. All modifications of the module will appear after
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
reloading it in the other opened project, where this module is used as a part of
the project model.
Dependencies by relationships
Dependencies by reference
Diagrams dependencies
PACKAGES
DEPENDENCIES BY RELATIONSHIPS
3-68
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
In this situation, MagicDraw can suggest moving relationship into the parent package of
this external element, e.g. in this example package1 is a parent of class B, so the
relationship can be moved from module into package1:
This movement can be done in the Package Dependencies dialog box, by clicking the Solve
button. For a detailed description of this dialog box, see Section Package Dependencies
dialog box on page 3-72.
Also you may draganddrop the relationship from one package to another manually in
the Browser tree.
3-69
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
If you want to skip this dependency, click the Export button. After opening the module as a
separate project, this relationship will be absent.
3-70
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
contained in an external model, such package can be exported into independent module
without warnings:
Figure 35 -- Example of relationship when module does not depend on external element
DEPENDENCIES BY REFERENCE
Module depends on external elements, when model elements from modules packages
have references to external elements.
In this case, the module package cannot be exported into independent module.
DIAGRAMS DEPENDENCIES
Diagram depends on all model elements displayed in this diagram.
If diagram is contained in some module package and depends on external elements, this
package cannot be exported into module.
About the package dependency on external elements, see Section Module depends on
external elements on page 3-68.
3-71
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
In this case, if diagram is not important for the module, it can be moved from the module
package into any external package manually by dragging and dropping in the Browser
tree:
Figure 38 -- Diagram is moved from the module package to the package1 package.
Pa c k a g e D e p e n d e n c i e s d i a l o g b o x
The Package Dependencies dialog box appears when the package cannot be exported to
the project module, because dependencies with external model elements are found (see
more detailed information about the types of package dependencies in the Section
Packages dependencies by relationships on page 3-68.
3-72
WO R K I N G W I T H P R O J E C T S
Modules Functionality. Reusing project part - Partitioning
Box name
Function
Status
Module Element
Element Type
Dependency Type
Depends On
Solve
Warning.
Refresh
Export
Cancel
Help
Every MagicDraw UML project module (package or diagram) or group of them can be
saved into separate xml file: from the File menu, choose Export, and then choose
Profile/Module command.
You can save reusable model part as module xml file. Module file is a simple MagicDraw
project file and can be opened as separate project.
Module xml file later can be imported into other MagicDraw project: choose the Import
command from the File menu. All elements from module xml file are copied into the target
project. There is no linkage between these two projects (files) after import; both these files
can be used separately.
NOTE:
We do not suggest using modules for splitting project into parts and developing
these parts simultaneously. After splitting, you will need to merge all project parts
into one project. Only model elements are merged on import. If you have the
same diagram exported into separate files, it will be duplicated after importing it
back. We use simple rule for model elements merging - two model elements are
equal if names are equal. If the same model element was exported into two files
and name of it was changed in one file, you will have two model elements after
merging these two parts.
Primary purpose of Save Project Module functionality was to allow the user to export some
project part into separate file and import later it into another project. This is not the same as
splitting project into parts and connecting these parts into one project later.
3-73
WO R K I N G W I T H P R O J E C T S
Profiles
The best solution for group work on the same project is MagicDraw Teamwork Server. For
more information about the Teamwork Server, see the MagicDraw Teamwork System Users
Guide.
PROFILES
The profile is defined using the extensibility mechanisms of UML, which allow modelers to
customize UML for specific domains, such as software development processes. In
MagicDraw, profiles mechanism is similar to modules functionality although the profile is a
package with stereotype <<profile>> and its content is visible in Profiles dialog box, and
UML extensions tabs of Specification dialog boxes.
There are several ways of how you may work with profiles. You may:
1 Create your own profile.
2 Use already created profile.
3 Import already created profile
4 You may export your created profile.
Creating profiles
Usually the profile contains specific stereotypes, constraints, tagged values that you may use
according your needs. Sometimes profiles also contain other specific model elements and
MagicDraw allows to include them into profile. You can use your created profile in other
projects parts or other projects. Also other users also may reuse it as a module.
elements you need for extending UML. How to add stereotypes, tagged values,
or constraints to the profile (package), see Section UML Extension
Mechanisms on page 5-323.
The created profile will appear in the Profiles dialog box and in the Tagged Values and
Stereotypes tabs of Specification dialog boxes. More about working with UML extensions,
see Section UML Extension Mechanisms on page 5-323.
3-74
WO R K I N G W I T H P R O J E C T S
Profiles
where the desired profile is located, then choose the desired profile, and click
OK.
The chosen profile will appear in the Browser tree in a read-only status. You may use it in
your project. Also you may import it and edit, if needed.
From the profile, that you have chosen to use, shortcut menu in the Browser,
choose Modules and then Import Module.
From the File menu, choose Import. The Import dialog box appears. Choose the
profile you want to import and click Open.
The imported profile will appear as a editable package in the Browser. You will be able not
only to use the contents of package and also to edit it.
3-75
WO R K I N G W I T H P R O J E C T S
Model Differencing
Exporting profiles
If you want to use the created profile in the other project or provide the ability for other
users to use your profile, you may save the created profile in the selected directory.
Exporting profiles is similar to exporting modules functionality.
1 From the File menu, choose Export, and then choose Profile/Module.
2 The Export Profile/Module dialog box appears. Choose the <<profile>>
package you want to export and add to the Selected. Write the description of
the profile, click OK and save it to the desired directory.
MODEL DIFFERENCING
Since MagicDraw version 9.0, model differencing functionality is presented. Now you are
able to compare two MagicDraw UML local projects or teamwork project versions, as well
as diagrams. Model elements are compared by elements ID.
3-76
WO R K I N G W I T H P R O J E C T S
Model Differencing
diagrams
Models comparison
First of all you have to choose projects you want to compare. Model comparison will be
displayed as two model trees. Differences between model versions are marked using colors
and highlighting.
When comparing two models such data changes will be reflected:
Compare Projects.
2 The Compare Projects dialog box appears.
3 From the Active Project combo box, choose a project you want to compare with
another project. The list contains names of all opened projects in MagicDraw.
4 From the Compare With combo box, choose a project with which you want to
compare the first project. The following options are available:
3-77
WO R K I N G W I T H P R O J E C T S
Model Differencing
opened project names are listed, except the project, which is selected
in the Active Project combo box.
Local Project. Click the "" button and choose a project version you
want to compare the current project with.
Teamwork Project. Click the ... button and from the Open Teamwork
Project dialog box, select a project ant its version you want to
compare with.
3-78
WO R K I N G W I T H P R O J E C T S
Model Differencing
In the Difference Viewer dialog box two compared projects are displayed. At the bottom of
the dialog box number of differences is displayed. Differences number includes inserted,
deleted, and modified elements. Number does not include elements that inner elements are
changes. Differences number is displayed in following order:
For marking model element changes several colors are used:
Elements that do not exist in the other model (inserted elements). Element is
displayed only in the right-hand tree. New element is highlighted in light green
color.
Elements that exist in other model, but do not exist in current model (deleted
elements). Elements always are displayed in the left-hand tree. Deleted element
is highlighted in grey color.
3-79
WO R K I N G W I T H P R O J E C T S
Model Differencing
Elements that inner elements are changed. Element is marked in both trees.
Such element is highlighted in light grey color dashes. Element with modified
element data and changed inner elements is marked as modified and as
element with changed inner elements. Element is marked as modified when:
Function
Both trees are expanded.
Expand All
Both trees are collapsed.
Collapse All
Select the difference, which is previous to the selected one.
Go to Previous
Difference
Select the difference, which is next to the selected one.
Go to Next
Difference
The Filter dialog box appears. Show/hide the elements you want to
analyze.
Filter
2005 No Magic, Inc
3-80
WO R K I N G W I T H P R O J E C T S
Model Differencing
Button
Function
Relations are displayed in elements specification. Relation added to
element means that element is marked as modified.
Include
Relation Ends
Display:
Find Next
Element
More>>
<<Less
Export
Differences
The first column of the Property window contains the same properties as the Quick
Properties tab in the Browser. The second column title is left-hand project name (with path)
for local projects, and teamwork project name and version number for teamwork projects.
The third column title is right-hand project name (with path) for local projects, and
teamwork project name and version number for teamwork projects. Modified properties are
marked with the same color as in model element tree.
Diagrams Comparison
To compare diagrams
1 In the Difference Viewer dialog box, select the diagram you want to compare
3-81
WO R K I N G W I T H P R O J E C T S
Model Differencing
2 The Diagrams Difference Viewer dialog box appears, which displays both
Current (or first opened) project diagram is displayed at the right-hand side.
Symbol deletion
3-82
WO R K I N G W I T H P R O J E C T S
Working with multiple projects
Function
If pressed, zooming affects both diagrams: zooming one
diagram invokes zooming of another diagram.
Synchronize Zooming
If pressed, scrolling one diagram invokes scrolling of another
diagram.
Synchronize Scrolling
If pressed, places where diagram has changed are marked on
both diagrams.
Mark Changes
Prints the corresponding diagram together with marked
changes.
Print Diagram
Zooms the corresponding diagram(s) to the original size.
Zoom 1:1
Zooms the corresponding diagram(s) to the size that fits in
window.
Fit in Window
Zooms the corresponding diagram(s) in.
Zoom In
Zooms the corresponding diagram(s) out.
Zoom Out
Choose the percentage for zooming the corresponding
diagram(s).
3-83
In the Projects drop-down combo box, click the additional project you wish to
open.
2005 No Magic, Inc.
WO R K I N G W I T H P R O J E C T S
Using Browser
Choose Projects from the File menu and click the name of the project you wish
to open.
The project you are currently closing will be saved (its name appears
in the question). Dialog box is displayed again when the next project
closes.
Yes To All
Save all projects without prompting. The Save dialog box appears for
each opened project.
No
Project you are currently closing will not be saved. The dialog box is
displayed again when the next project closes.
No To All
Cancel
NOTE
Use the Cut, Copy, and Paste commands in the Edit menu, or appropriate
shortcut keys: Ctrl+X, Ctrl+C, Ctrl+V or the toolbar buttons.
Drag-and-drop the created model element from the Browser tree to the
Diagram pane.
Data may only be exchanged between projects that are currently opened within
MagicDraw. You may not copy/paste elements between instances of different
tools that are currently running or to other applications.
USING BROWSER
The Browser provides a visual representation of the hierarchy for your model elements. The
items in this hierarchy are either:
Compressed - a plus sign next to an icon indicates that the icon is compressed,
that is, it contains other model elements. This is the default setting when you start
3-84
WO R K I N G W I T H P R O J E C T S
Using Browser
your application. Click the plus sign to expand the icon and view its subordinate
items.
Expanded - a minus sign next to an icon indicates that the icon is fully
expanded. Click the minus sign to collapse the item.
If there is no sign next to an icon, means that it does not contain other model elements.
The Browser is a hierarchical navigational tool that allows you to manage your model data,
including packages, components, classes, all UML diagrams, extension mechanisms, and
other data. You may use the Browser as an alternative tool to the menus and toolbars that
are in MagicDraw. It is easier to work with projects diagrams and data elements using the
Browser. The Browser performs the following operations:
Dragging and dropping of model elements to the Diagram pane and inside the
Browser.
Dragging and dropping of data in the Code engineering sets (you may create
data in the Data branch, drag it to the Code Engineering sets, and the round trip
object is created automatically).
Symbol creation for the selected model element in the current diagram.
Managing diagrams.
Filtering of the visible items (by any model type, e.g. class, package, operation,
component, state and others - both for views and dates), when the Filter from
the Browser shortcut menu is selected.
3-85
WO R K I N G W I T H P R O J E C T S
Using Browser
Figure 45 -- Browser
When at least one Project is open, the Browser is placed to the left side of the main window.
Since MagicDraw version 7.5 it is possible to place Browser in any plane of the MagicDraw
3-86
WO R K I N G W I T H P R O J E C T S
Using Browser
application, also all tabs can be viewed separately, you may set up Browser according your
need by hiding the desired tabs.
box appears.
2 In the Browser tab, change the Browser Position property to Right or Left.
Containment tree
The Containment tree displays model data, grouping it in logical sets.
3-87
Click the Containment Tree tab in the upper side of the Browser.
WO R K I N G W I T H P R O J E C T S
Using Browser
If the Containment tree is hidden, from the Window menu, choose Containment
Tree.
In the Containment Tree tab, click the Show Full Types in Browser button
In the Containment Tree tab, click the Show Stereotypes in Browser button
In the Containment Tree tab, click the Show Code Engineering Sets button
3-88
WO R K I N G W I T H P R O J E C T S
Using Browser
2 In the Browser tab, set the Show Code Engineering Sets check box to true
(default true).
DATA BRANCH
The Data branch represents a projects model and structure. All model elements are stored
in packages. This helps you distribute data into logical groups. By default, all new model
elements data (inner structure) are stored in the Data package. You may create your own
packages for storing your model elements data.
The Data branch also contains the Component View, Data Types, and Relations (appears
only when at least one path is drawn on the diagram pane) branches.
Component View is already created package where the components during code
engineering are placed.
Data Types contains the list of primitive data types: Boolean, byte, char, double, float, int,
long, short, and void. You may create your own data types.
shortcut menu or open the Code Engineering Sets dialog box and click the New
button. The New Set dialog box appears.
2 Type the set name and select programming language from the drop-down list
(by default - Java).
3 Click OK to finish set creation.
3-89
WO R K I N G W I T H P R O J E C T S
Using Browser
To check syntax
Choose Check Syntax from the set shortcut menu. If no errors are found, the
There are no syntax errors in the model message box appears.
For the detailed descriptions about the reverse, see Section Reverse in the Code
Engineering Users Guide.
TIP!
For the detailed descriptions about the reverse, see Section Reverse in the
Code Engineering Users Guide.
All above listed functions can be performed in the Code Engineering Sets dialog
box.
3-90
WO R K I N G W I T H P R O J E C T S
Using Browser
2 Select the directory where the text editor is located and Arguments.
3 Click OK.
The classpath is defined in the Project Options dialog box, Java Language
Options pane.
Diagrams tree
The Diagrams tree in the Browser represents a diagrams external structure.
In the Diagrams tree, with the selected diagrams, you may perform the operations listed
below.
From the shortcut menu, select the Group by Diagram Type check box.
3-91
WO R K I N G W I T H P R O J E C T S
Using Browser
Also in the Diagram Specification dialog box you may add documentation of the
diagram, define steretypes, contraints and tagged values, view ther relationships
in which the diagram participates, and difine hyperliks.
Choose Print from the diagram item shortcut menu. If the diagram is empty, it
will not be printed.
Also there are other ways for printing diagram. For more details about printing,
see Section Printing on page 4-165.
Inheritance tree
The Inheritance tree represents classes, packages, interfaces, primitive data types hierarchy
of your project. The inheritance according UML Specification is shown using generalization
relationship.
3-92
WO R K I N G W I T H P R O J E C T S
Using Browser
For more information about managing model elements from the Browser, see Section
Working with model elements in the Browser tree on page 3-95.
In the Inheritance Tree tab, click the Show Stereotypes in Browser button
M o d e l E x t e n s i o n s Tr e e
The Model Extensions Tree contains all Stereotypes, Tag Definitions, and Constraints that
are predefined and created manually in the project.
In this tree you may create, review, copy/paste, and delete extensions mechanisms.
It can be mainly used for the work of the team using the Teamwork server for locking for
edit/unlocking extension mechanisms.
3-93
From the Model Extensions Tree shortcut menu, select the Group by Profiles
check box.
WO R K I N G W I T H P R O J E C T S
Using Browser
In the Model Extensions Tree, click the Group by Base Class button
From the Model Extensions Tree shortcut menu, select the Group by Profiles
check box.
S e a r c h Re s u l t s Tr e e
The Search Results tree shows results of the search, which may be performed through the
Find dialog box.
From Diagrams - shown are those elements that are displayed on the
diagram(s).
From Model - shown are those elements that are created in the model data.
To open the Find dialog box, from the Search Results Tree
Click the Find button
3-94
WO R K I N G W I T H P R O J E C T S
Using Browser
Wo r k i n g w i t h m o d e l e l e m e n t s i n t h e B r o w s e r t r e e
To create a model element or a diagram in the Browser
1 Right-click the package in the Browser.
2 From the New command, select the model element or a diagram you wish to
create.
To copy/cut and paste the selected model element in the Browser tree
1 Choose Copy or Cut from the item shortcut menu.
2 Select an item where you wish to put the copy of the model element.
3 Choose Paste from the item shortcut menu.
To copy/cut and paste the selected model element among different projects
1
2
3
4
You may draw a symbol by dragging and dropping an item to the Diagram pane
elements that you would not like to appear in the Browser tree
3-95
WO R K I N G W I T H P R O J E C T S
Using Browser
Multiple selection
A group of model elements can be selected within the Browser tree, and you may edit all
the selected model elements at the same time.
Hold down the SHIFT key and click the last element you wish to include in to
multiple selection.
For more precise selection, hold down the CTRL key and click (while holding the
key down) with the mouse on the elements you wish to select.
D o c u m e n t a t i o n / Z o o m C o n t r o l / Pr o p e r t i e s
DOCUMENTATION TAB
The Documentation tab shows information associated with the selected model element in
the Browser tree or diagram.
3-96
WO R K I N G W I T H P R O J E C T S
Using Browser
To zoom in for a close-up view of your diagram, or to zoom out and see more of the
diagram at a reduced size
1 Click the Zoom Control tab in the Browser window.
2 Drag the rectangle or drag the slider.
NOTE:
By default the zoom slider is not visible. To display the zoom slider in the Zoom
Control tab, in the Environment Options dialog box, Browser tab, select the Show
Diagram Zoom Slider check box.
Quickly access any part of the diagram using the Zoom Control tab
Drag the blue square to the desired part of the diagrm. The desired diagram part
will be displayed on the diagram window.
3-97
WO R K I N G W I T H P R O J E C T S
Using Browser
PROPERTIES TAB
Since MagicDraw version 8.0, you may edit model elements and diargram properties such
as data, sybol properties, language properties directly from in the Browser, Properties tab.
Properties tab has two modes - Standard ant Expert. Depending on your needs you may
choose one of them.
3-98
WO R K I N G W I T H P R O J E C T S
Searching
SEARCHING
MagicDraw search mechnism enables the serch within model elements data, symbols, and
extensions.
You may also search for usages and dependant elements of the selected elements. This
functionality is described in Section Usages functionality on page 4-146 and in Section
Dependent Elements functionality on page 4-146.
TIP!
or click the Find button on the main toolbar. The Find dialog box appears.
2 Type the "*" symbol in the Name text box.
3 Click the "..." button near the Type text box to open the Select Model Elements
Types drop-down combo box. Select types of elements and click OK. Model
elements in this box are listed according metamodel.
4 Click the Find button to start search. The search results appear in the Search
Tree in the Browser.
To generalize the beginning or ending of the name, add the "?" symbol in the
front or in the end of the string.
TIP!
3-99
WO R K I N G W I T H P R O J E C T S
Searching
NOTE
If the Clear Previous Results check box is cleared, new results are appended to
previous search results in the tree.
TIP!
Select Search Data Unused in Diagrams check box to find only elements lacking
shapes.
Element
Function
3-100
WO R K I N G W I T H P R O J E C T S
Searching
Name
Type
Value
Only available
for Search
Element by
Tagged Value
and Constraint
Value tab.
Case Sensitive
Searches for the groups of items that have the names and
capitalization exactly as defined in the string entered in the Item
to Find box.
When unselected, MagicDraw UML does not distinguish
between uppercase and lowercase characters of the item name
entered in the Name box while searching for the item.
Match Whole
Words Only
Searches for the groups of items with names that exactly match
the string entered in the Item to Find box.
When unselected, the MagicDraw searches for the groups of
items with the names matching the first parts of the string
entered in the Name field.
Search Data
Unused in
Diagrams
Java Regular
Expression
Clear Previous
Results
Find
Searches for items and displays the results of the search in the
found items list field. If MagicDraw does not find any item, the
message is displayed.
Close
Help
J a v a Re g u l a r E x p r e s s i o n s
METACHARACTERS
There are supported several character, which are used to form search pattern
([{\^$|)?*+.
3-101
WO R K I N G W I T H P R O J E C T S
Searching
CHARACTER SETS
[abc]
Any character of a, b or c
[^abc] )
[a-z]
[a-z[A-Z]]
[a-z&&[r-z]]
[a-z&&[^r-z]]
Any character
\d
\D
\s
\S
\w
\W
Example:
Regular expression: [ABC][^\s]\d
Matched text: any sequence starting with a "A", "B" or "C" symbol, followed with
any non white space character and any digit.
GROUPING
Capturing groups helps to treat multiple characters as single unit.
Example:
Regular Expression: ABC|(\dABC)
Matched text: any text containing ABC symbols set or ABC symbol set beginning
with any digit symbol
QUANTIFIERS
Quantifiers allow specify a number of character X appearance.
X?
X*
X+
X{n}
3-102
WO R K I N G W I T H P R O J E C T S
Searching
X{n,}
X{n,m}
Example:
Regular expression: Cla(s{2})
Matched text:any sequence starting with "Cla" symbols, followed with "s" symbol
two times. It shall match any text containing string "Class"
BOUNDARY MATCHERS
Boundary matchers help to match strings more precisely. Helps to match particular word,
matches at the beginning of the input or line.
^
\b
A word boundary
\B
\A
\z
Example:
Regular expression: \bCla(s{2})\b
Matched text:any sequence starting with "Cla" symbols, followed with "s" symbol
two times. It shall match any text containing string "Class" as whole word ("Classs"
won't be matched)
EMBEDDED FLAG EXPRESSIONS
Allows to set properties for regular expression matcher.
(?i)
(?x)
(?m)
(?s)
(?u)
(?d)
Example
Regular expression: (?m)^\bCla(s{2})\b
Matched text: any sequence from new line, starting with "Cla" symbols, followed
with "s" symbol two times.
References
3-103
WO R K I N G W I T H P R O J E C T S
MagicDraw and Rational Rose
http://java.sun.com/docs/books/tutorial/extra/regex/index.html
Ra t i o na l Ro s e
To prepare Rational Rose for XMI exchange
1 Download Rose 2001a/2002 XMI support add-in at
ftp://www6.software.ibm.com/software/developer/library/rational/2834/Rose/
RoseXMLTools1.3.6.01.zip
2 After you have installed XMI support for Rational Rose, two new menu items
Export Model to UML and Import UML Model appears under Tools menu. These
items are for XMI exchange.
3-104
WO R K I N G W I T H P R O J E C T S
MagicDraw and Rational Rose
3 From the Output File Basis group box, select the Model option button.
4 Click OK.
Before exporting Rational Rose project, it must be saved as MDL file. While
exporting: XMI 1.0 and Model option buttons should be selected.
Open.
3 The Rose UML Import Options dialog appears, click OK.
WO R K I N G W I T H P R O J E C T S
MagicDraw and Rational Rose
MagicDraw
To export MagicDraw project to Rose supported XMI format
1 Open the project file you want to export to XMI format.
2 From the File menu, choose the Export As Unisys XMI.
3 The Save dialog box appears. Type the name of the project and choose the
Open button.
3-106
WO R K I N G W I T H P R O J E C T S
MagicDraw and Rational Rose
Common
Class diagram
Use Case
diagram
Collaboration
diagram
3-107
Data Type
Primitive
Programming Language Data
Type
Enumeration
Collaboration
Object and Link
Dependency between Package
and Class
Subsystem and Model (are
imported as Packages with
appropriate stereotypes)
Containment
Generalization stereotype and
documentation are not exported
Include relationship
Extend relationship
Dependency between Use Cases,
between Actor and Use Case
Extension Point
Collaboration
Instance
Object
Subsystem Instance
Use Case Instance
Link
Stimulus
Nested message numbering
Classifier Role (is imported as
Object)
Association Role (is imported as
Link)
Does not read Association Role
name.
WO R K I N G W I T H P R O J E C T S
MagicDraw and Rational Rose
Field
Sequence
diagram
Diagonal message
Concurrent Lifeline
Recursive Message
State diagram
(Statechart
diagram in Rose)
Activity diagram
3-108
WO R K I N G W I T H P R O J E C T S
MagicDraw and Together ControlCenter
Field
Implementation
diagram
(deployment and
component
diagrams in
Rose)
OTHER
NOTICED INCOMPATIBILITIES
Unisys XMI format does not support rectilinear property and breakpoints for
relationships in the diagrams.
Rational Rose does not export symbol style for Package, Message, Component,
Transition, Synchronization and Swimlane.
Rational Rose does not export Show Class option for Object element in
Collaboration diagram.
Rational Rose does not export Show Actions and Show Nested Elements options
for State/Activity element in Statechart/Activity diagram.
If Note element is empty Rational Rose exports additional empty Note element.
Rational Rose does not export anchor between Note and Link, Note and
Message, Note and Connection.
After importing Rational Rose, doesn't display inner state as inner. Although it is
inner in model data.
3-109
WO R K I N G W I T H P R O J E C T S
MagicDraw and Together ControlCenter
To g e t he r C on t r o l C e n t e r
To export the Together ControlCenter project to Unisys XMI Extensions file.
1 From the File -> Export menu, choose the Model to XMI File command.
2 The Export to XMI dialog box appears. Select the XMI 1.0 for UML 1.3 (Unisys
Extension) option button from the Select XMI Type group box.
While exporting: XMI 1.0 for UML 1.3 (Unisys Extension) check box should be
selected.
3-110
WO R K I N G W I T H P R O J E C T S
MagicDraw and Together ControlCenter
2 The Select XML Document dialog appears, choose the desired XML file and
MagicDraw
To export MagicDrawTM UML project to Unisys XMI format
1 Open the project file you want to export to XMI format.
2 From the File menu, choose the Export as Unisys XMI.
3 The Save dialog box appears. Type the name of the project and choose the
3-111
WO R K I N G W I T H P R O J E C T S
MagicDraw and Together ControlCenter
2 The Open dialog box appears. Choose the desired project file and click the
Open button.
Field
Common
Class diagram
3-112
WO R K I N G W I T H P R O J E C T S
MagicDraw and Together ControlCenter
Collaboration diagram
Association
Sequence diagram
State diagram
(Statechart diagram)
Dynamic Choice
Does not import State
diagram
Action State (is imported as
Activity in <default> diagram)
Concurrent State (is imported as
State)
Synch State (is imported as State)
Junction Point (is imported as
Decision)
Stub State (is imported as State)
Submachine State (is imported
as State)
Call State is (imported as State)
Activity diagram
3-113
WO R K I N G W I T H P R O J E C T S
Resources Manager
Implementation
diagram (deployment
and component
diagrams)
OTHER
NOTICED INCOMPATIBILITIES
RESOURCES MANAGER
MagicDraw Resource Manager functionality allows you to manage local (installed with
MagicDraw, downloaded) resources and resources available on web.
With RM (Resource Manager) you may manage different types of resources (Profiles,
Plugins, Templates, Language resources, Case studies/examples, Custom diagrams, and
others).
RM lets:
Review
Remove (delete)
Import, download
Update resources.
3-114
WO R K I N G W I T H P R O J E C T S
Resources Manager
3-115
Element Name
Function
Name
ID
Resource ID.
Category
Resource type.
State
Ver Obtained
Ver Available
WO R K I N G W I T H P R O J E C T S
Resources Manager
Date
Size
Meaning of text
colors
More>>/<<Less
Download/Install
Remove
Import
NOTE
3-116
3-117
WO R K I N G W I T H P R O J E C T S
Resources Manager
WO R K I N G W I T H P R O J E C T S
Resources Manager
3-118
DIAGRAMS BASICS
This chapter offers an overview of working with diagrams. In general, the topics discussed
apply to all the supported diagram types.
Concepts that can be useful:
A path refers to the notation for the various kinds of relationships such as
associations, aggregations, dependency, message, and links.
The MagicDraw Enterprise edition contains a Content Diagram, which is used for
managing all project diagrams as well as works as table of contents. More
information about Content Diagram, find in the Section Content Diagram on
page 6-359.
4-120
DIAGRAMS BASICS
Working with Diagrams
appears. Enter the name of the diagram and select or create a package where
you wish to create your diagram.
NOTES
To open diagram
If the diagram is assigned to some model element, by double clicking this model
element.
TIP 1!
To open all diagrams, that are created in the project, from the Diagrams menu,
choose Load All Diagrams.
TIP 2!
To open the list of diagrams that were lastly closed, from the View menu, choose
Recently Closed Diagrams and double-click the diagram you want to open. Also
F12 activates this command.
TIP 3!
In the Environment Options dialog box, General pane, you may choose a way
for loading diagrams while opening a project. Three options are available:
4-121
DIAGRAMS BASICS
Working with Diagrams
Load all Diagrams opens all diagrams that are created in the project.
Load Only Opened Diagrams opens only diagrams that were not closed in
earlier usages of the project.
Do not Load Diagrams all diagrams are closed after opening a project.
To close diagram
Click the Close Diagram button on the diagram pane or choose Close Diagram
from the diagram shortcut menu.
Define a diagram in the corresponding Diagram Specification dialog box.
Diagram Specification dialog box
Refer to the Section Specification dialog boxes on page 4-133 for the information of this
specification elements.
To rename a diagram
In the corresponding Diagram Specification dialog box, enter a new diagram
name.
4-122
DIAGRAMS BASICS
Working with Diagrams
Owner
Edit
The Diagram Specification dialog box appears. Type the diagram name,
select a package, and click OK.
Add
Creates a new diagram. The Create Diagram dialog box appears. Type the
diagram name, select a package, and click OK.
Remove
Open
OK
Saves all actions performed during the session and exits the dialog box.
Cancel
Cancels all actions performed during the session and exits the dialog box.
Help
4-123
DIAGRAMS BASICS
Working with Diagrams
D i a g r a m Pr o p e r t i e s
Customize the diagram style (color, grid) in the Diagram Properties dialog box.
Choose Diagram Properties from the diagram shortcut menu. The Properties
dialog box appears.
From the Edit menu, choose Symbol, and then choose Diagram Properties.
Press SHIFT+ENTER.
Function
Background Color
Show Grid
Grid Size
4-124
DIAGRAMS BASICS
Working with Diagrams
Element name
Function
Show Message
Numbers
Show Activations
Apply Style
Make Default
OK
Cancel
Help
Diagram name
Author
Creation date
Modification date
Options menu, choose Project. The Project Options dialog box appears.
2 Open the Diagram Info pane.
3 In the Source pane, choose the type of information you want to include in the
table: Standard Mode or Custom Mode.
4-125
DIAGRAMS BASICS
Drawing Shapes
4 Standard Mode contains the following fields that will be shown in the table:
Author, Creation date, and Modification date and all other tag definitions that
can be assigned to the diagram.
In the field Custom Mode, you may create your own table or any other object in
HTML.
5 Preview the selected table or other created object in the Preview pane.
DRAWING SHAPES
To draw a shape on the Diagram pane
1 Click the shape button on the diagram toolbar, or press the appropriate
shortcut keys for the shape you wish to draw (the button remains pressed). For a
detailed description of diagram toolbars, see Section Toolbars on
page 9-447.
2 Click the desired location on the diagram pane. The new shape is placed on
the diagram pane at the point you click.
Create the desired model element in the Browser tree. From the created item
shortcut menu, choose Create Symbol or drag and drop the selected model
element to the diagram pane.
shortcut keys for the shape you wish to draw (the button remains pressed.)
Click the Sticky button on the diagram toolbar (shortcut keys Z or
CTRL+SHIFT+Z.)
Click the desired location on the diagram pane. The new shape is placed on
the diagram at the point you click (the button remains pressed.)
Click the next location on the diagram pane. The next shape is placed on the
diagram pane. Repeat this until you draw a desired number of shapes.
To undo, click the Sticky button on the diagram toolbar (shortcut keys Z or
CTRL+SHIFT+Z.)
4-126
DIAGRAMS BASICS
Drawing Shapes
Type the shape name directly on the selected shape on the Diagram pane.
Type the shape name after slow double-clicking the shape in the Browser
tree.
From the shortcut menu of the desired item in the Browser tree, choose the
Create Symbol command. Or, drag and drop the selected model element
onto the diagram pane.
Type the same name for multiple shapes directly on the shape after the text
cursor appears in that area.
NOTES:
appears.
4 Choose a name of the shape from the list.
These shapes will contain equivalent data.
Auto completion for entering names is available only for classes, actors,
packages, and subsystems.
dialog box, you will receive an error message notifying you of the existence
of the current name of the shape. You may not specify a name for a new
shape if another shape of the same name and kind is already present in the
package.
4-127
DIAGRAMS BASICS
Drawing Shapes
Function
Scope
Depth
Relations
4-128
DIAGRAMS BASICS
Drawing Relationship paths
To display paths among shapes that already are created in the model data
Select a symbol and from the Edit menu, choose Symbol and then choose
Display Paths.
From the Edit menu, choose Delete (data together with symbol is deleted.)
On the main toolbar, click Delete (data together with symbol is deleted.)
NOTE
D R A W I N G R E L A T I O N S H IP P A T H S
To create a path between shapes
1 Click the appropriate path button on the diagram toolbar for the relationship
you wish to draw. For a detailed description of diagram toolbars, see Section
Toolbars on page 9-447.
2 Click the first (source) shape of a path.
3 Drag the path to the second (target) shape of a path and drop it there.
4-129
DIAGRAMS BASICS
Smart Manipulation
2 Right-click the path or choose Path from the Edit menu, and choose the
NOTES:
To choose in turn one of the path styles, choose Change Path Style
(shortcut keys CTRL+L.)
Every diagram has the Manipulation Highlighting feature. When you try to draw
a path between two model elements, you will see that those shapes are
bordered with the red or blue rectangle. The red color means that the path may
not be drawn between these shapes.
SMART MANIPULATION
To make the work with MagicDraw easier, smart manipulation (smart control) function is
presented. Using it, you may easily suppress attributes and operations, draw some kinds of
relationships, set an autosize option, and reset labels position.
4-130
DIAGRAMS BASICS
Selection. Multiple Selection
Autosize option is added for all shapes. For various shapes different smart mechanisms are
presented:
Class, actor
Use case
Package, Subsystem,
Model
Draw dependency
Draw link
Draw transition
Component
Draw association
Note
Anchor to note
Paths
box appears.
2 In the Diagram pane, set the Use Smart Manipulation check box to False and
click OK.
number of shapes.
4-131
DIAGRAMS BASICS
Dragging, Copying, Cutting, and Pasting
Drag the cursor diagonally across the area you wish to select. All shapes in the
selected area will be selected.
D R A G G IN G , C O P Y I N G , C UT T I N G , A N D P A S T IN G
Move a shape to another place on the diagram pane by dragging-and-dropping.
You may select several model elements and draw them on the diagram pane.
If the selected model elements are not compatible with the opened diagram,
you will not be allowed to draw those model elements.
You may copy/paste many (but not all) model elements among various diagrams.
To paste one or more copied model element by creating new data and symbols
From the Edit menu, choose the Paste With New Data command (shortcut keys
CTRL+E.)
4-132
DIAGRAMS BASICS
Specifying Model Elements
To copy the selected model elements and paste to MS Office or other application
1 Select the desired model elements on the diagram pane.
2 From the Edit menu, choose the Copy as EMF or Copy as JPG (shortcut keys
TIP!:
NOTE:
CTRL+SHIFT+E or CTRL+SHIFT+J.)
3 Open the desired application and paste the copied model elements.
You are allowed to drag and drop source code files from the native file manager
to a MagicDraw Code Engineering Set.
You may copy or cut and paste the text only when using the shortcut keys
CTRL+C or CTRL+X and CTRL+V. When you use the buttons or commands, the
whole element is copied/cut and pasted.
properties directly from the Browser, Quick Properties tab. More about this
functionality, read in Section Properties tab on page 3-98.
The element Specification dialog box appears, when adding one model element
to another model element from the Specification dialog box or Browser.
The Specification dialog boxes are used to define UML model elements such as class,
package, activity, and others. Every Specification dialog box has a different structure based
on the element characteristics.
4-133
DIAGRAMS BASICS
Specifying Model Elements
Model elements that may participate in the relationships, have the Relations tab. All model
elements specification dialog boxes have the Stereotypes, Tagged Values, Constraints, and,
if desired, Hyperlinks tabs. The descriptions of these tabs see in the following sections.
RELATIONS TAB
The Relations tab contains the list of relationships in which the appropriate model
element participates.
Element name
Function
Name
Type
Begins
Relationship source. The name of the shape from which the path
begins.
Ends
Edit
Remove
Filter
4-134
DIAGRAMS BASICS
Specifying Model Elements
STEREOTYPES
TAB
4-135
Element
name
Function
Profile
All
The list of all stereotypes that are predefined to the selected model
element.
Selected
The list of stereotypes that are shown on the selected model element
shape.
>
Adds the selected stereotype from the All to the Selected list. This
stereotype becomes visible on the symbol.
<
Removes the selected stereotype from the Selected list. This stereotype
becomes invisible.
>>
Adds all stereotypes from the All list to the Selected list.
<<
Removes all stereotypes from the Selected list back to the All list.
Edit
Stereotypes
The Profiles dialog box appears. Edit, add, or remove stereotypes for
the selected model element.
DIAGRAMS BASICS
Specifying Model Elements
TAGGED VALUES
TAB
Element name
Function
Profile
The list of profiles that are available for the current project.
Group By Stereotype
Displays that types of tag definitions in the list.
Show Tag Definitions
Types
4-136
DIAGRAMS BASICS
Specifying Model Elements
Element name
Function
The list of tag definitions with values that are selected for
the current model element.
Create Value
Remove Value
Removes the value(s) from the selected tag definition.
(available only when the
tag definition has value)
Edit Value
4-137
Click the ... button and edit the selected tag definition in
the Tag Definition Specification dialog box.
HTML
Edit
Add
Remove
DIAGRAMS BASICS
Specifying Model Elements
CONSTRAINTS
TAB
Element name
Function
The list of constraints assigned to the current model element.
Add
Remove
...
Name
Base Classes
Expression
Documentation
4-138
DIAGRAMS BASICS
Specifying Model Elements
GENERAL
TAB
Type or view the model element name. If you enter the name of the already existing model
element, an error message box appears.
For some model elements (for example attribute, operation, etc.), the default name Untitled
Documentation is a comment associated with the selected constraint. To edit the comment,
click the
button, the Comment Specification dialog box appears. Edit the name, add
stereotypes, tagged values, and/or constraints to the comment.
Also you may write documentation in HTML format. Just select the HTML check box and
menu with available text formatting buttons appears.
Button
4-139
Function
Text Color
Font Name
Font Size
Bold
Italic
Underline
Align left
Center
DIAGRAMS BASICS
Specifying Model Elements
Button
Function
Align Right
Insert
Hyperlink
Unordered
list
Ordered list
Decrease
Indent
Increase
Indent
HTML
Source
For more information about documentation, see Section Documentation on page 4-170.
Abstract, leaf, or root check boxes
When selected one of the check boxes, the model element is correspondingly set as
generalizable model element - abstract, leaf, or root.
A generalizable element is a model element that may participate in a generalization
relationship.
Name
Function
Abstract
Leaf
Root
4-140
DIAGRAMS BASICS
Specifying Model Elements
ATTRIBUTES
TAB
Attributes tab contains the model element attributes list and buttons for editing attributes
list.
Name
Attributes name.
Classifier
Type
Initial Value
Edit
Add
Remove
Filter
4-141
DIAGRAMS BASICS
Specifying Model Elements
OPERATIONS
TAB
Operation tab Contains model element operations list and buttons for managing this list.
Name
Operations name.
Classifier
Return type
Edit
Add
Remove
Filter
4-142
DIAGRAMS BASICS
Specifying Model Elements
HYPERLINKS TAB
In the Hyperlinks tab, manage the hyperlinks you want to add to the model element.
Active
If selected, the hyperlink is activated and will work when doubleclicking the model element.
Hyperlink
Edit
Add
The Insert Hyperlink dialog box appears. Select the hyperlink you
want to add to the model element.
Remove
4-143
DIAGRAMS BASICS
Specifying Model Elements
BUTTONS
AVAILABLE IN THE
SPECIFICATION
DIALOG BOXES
Button
Function
OK
Cancel
Help
Owner
Fo r m a t i ng S y m b ol s
In MagicDraw, every symbol may have its own style: color, font, size, etc. There are several
ways to define symbol properties:
In the symbol properties dialog box: from the selected symbol shortcut menu or
from the Edit menu, Symbols command, choose Symbol(s) Properties.
In the Project Options dialog box. This dialog box enables you to change all
available symbols properties, create your own style for the project, apply
different symbol properties for different diagrams, define stereotypes properties,
that may be bound to the symbol, and many more.
Using MagicDraw main toolbar. Using MagicDraw toolbar, you may change
symbols color, font, and paths style.
From the Options menu, choose Project. The Project Options dialog box
appears. Choose the desired options for the selected model elements.
Select a symbol and from the Edit menu, choose Symbol, and then choose
Symbol(s) Properties.
To apply changes made in the Project Options dialog box, click
Apply.
NOTE
4-144
DIAGRAMS BASICS
Specifying Model Elements
Stereotype, and/or Show Tagged Values check box for the selected model
elements.
To apply changes made in the Project Options dialog box, click
the Apply button in the Styles tab.
NOTE
O w n e r o f t he m o d e l e l e m e n t
Model element and diagram belongs to a package, model (system boundary), subsystem or
other appropriated model element, which is called owner.
The name of the owner is shown in the model element name compartment in parentheses.
Drag a model element to the desired package on the Diagram pane or in the
Browser tree.
From the selected owner shortcut menu in the Browser tree, choose New
Element. From the list, choose the desired model element ant type its name on
the Browser.
TIP!
4-145
From the symbol shortcut menu, choose Symbol(s) Properties. The Properties
dialog box appears. Select/clear the Show Owner check box.
From the Options menu, choose Project. The Project Options dialog box
appears. Select the desired model element and select/clear the Show Owner
check box. Click Apply, if you want to apply changes for already created model
elements.
For a class, actor, and interface you may display/hide the name of the owner
from the symbol shortcut menu: choose Presentation Options, and then
select/clear the Show Owner check box.
DIAGRAMS BASICS
Model Traceability
MODEL TRACEABILITY
Usages / Dependencies functionality allows to track/view element dependencies in the UML
model.
Usages and Dependent Elements functionality will help you to find information how model
elements are used by another elements, what are relations between used and dependent
elements. Usages and Dependent Elements functionality is very useful for analyzing
associations between elements or searching for diagrams where these elements are
represented.
The Usages / Dependent Elements results window is not synchronized with model. So, if
there were made some actions with model elements, the Refresh button must be pressed in
order to synchronize it.
Usages functionality
In the Elements Using window are listed elements, which uses the current element.
For example: If element1 has reference to element2. This means that element1 uses
element2. So, element2 is used be elemen1. In the Attribute Specification dialog box, Type
combo box, add class2. This means that class2 is used by attribute.
Containing other elements is not usage. For example, when package has inner element
class, this doesnt mean, that package uses class. Class is only container of package.
4-146
DIAGRAMS BASICS
Model Traceability
Element Name
Function
Treat relationships as
search result
4-147
DIAGRAMS BASICS
Model Traceability
Element Name
Function
List usages/dependent
elements of every child
element
4-148
DIAGRAMS BASICS
Model Traceability
More information about the Elements Using /Dependencies window, is written in the table
bellow.
Item Name
Function
Expand
Collapse
Select in Containment
Tree
Open all diagrams that Diagrams which are mentioned in the usages / dependencies
contain current
tables are opened. In opened diagrams view is centered on
Usages/Dependencies used/dependent elements.
NOTE The Open all diagrams that contain current
Usages/Dependencies button is inactive if there are no elements
that are used in diagrams.
Show/hide the Full Path Next to the element name, full path is displayed.
Names
NOTE For symbol this button is not valid.
4-149
DIAGRAMS BASICS
Model Traceability
Refresh
Show
Usages/Dependent
Elements Options
Filter
Defining Hyperlinks
You may set text for notes, text boxes, or separators as HTML text. Also you may hyperlinks
to any model element.
NOTE
Hyperlink dialog box. If you want this hyperlink to be active, click the Active
Hyperlink check box.
3 Click OK.
The hyperlink is added as a tag definition.
Draw note or text box, using the Note (HTML text) or Text Box (HTML text)
toolbar buttons.
4-150
DIAGRAMS BASICS
Model Traceability
1 Select the text where you want to add a hyperlink and click the Insert Hyperlink
2 The Insert Hyperlink dialog box appears. Select the hyperlink you want to insert: to
To link to an existing Web page, click the Web Page tab, and in the Type
the Web page name text box, type the URL of a Web page you want to
link to. You may click the button and browse the Web for the
desired Web page.
NOTE
NOTES:
To link to an existing file, click the File tab, enter the path to the file you
want to link to. Or, click the Type the file name button and, in the
Open dialog box, select the file you want to link to.
The
Set
DIALOG BOX
note/text box text as HTML: choose HTML Text from the note/text box shortcut
menu.
-orCreate a text box or note by clicking the Text Box (HTML Text) or Note (HTML Text)
buttons.
2 Select the text. The HTML editor toolbar appears.
4-151
DIAGRAMS BASICS
Model Traceability
3 Select the text where you want to add hyperlink and click the Insert Hyperlink
button.
Tab name
Box
Function
Element/ Symbol
Creates a
hyperlink that
goes to the
selected model
element.
Text to display
Select Element
/ Symbol
Clear
Active
Text to display
Web Page
Creates a
hyperlink that
goes to the
specified Web
page.
4-152
DIAGRAMS BASICS
Laying out
Tab name
File
Creates a
hyperlink that
goes to the
specified file.
Box
Function
Clear
Text to display
Clear
LAYING OUT
With MagicDraw, it is easy to manage simple or complex diagrams using automated layout
features that optimize diagram layout for viewing.
Lay out your symbols on the Diagram pane using the Layout menu, or you can use the
symbol shortcut menu when two or more symbols are selected. Since MagicDraw version
8.0 new layout component is applied with much more possibilities for laying out your
models.
4-153
Orthogonal Layouter
2005 No Magic, Inc.
DIAGRAMS BASICS
Laying out
Hierarchic Layouter
Tree Layouter
Organic Layouter
Circular Layouter
Path Router
These layouters are provided by yFiles layouting component. Component webstart demo
version could be found at http://www.yworks.com/products/yed/demo/yed.jnlp.
User can layout each diagram (except Sequence and Time Diagram) by using 6 general
layouters. Class diagram also could be layouted using Class Diagram Layouter.
O r t h o g o n a l La y o u t e r
The Orthogonal Layouter is well suited for medium sized sparse diagrams. It produces
compact drawings with no shape overlaps, few crossings and few bends. All edges will be
routed in an orthogonal style, i.e. only rectilinear style paths will be used.
Orthogonal layout options
Option
Values
Default Value
Description
Use Existing
Drawing as
Sketch
boolean
false
False
Group Layout
Quality
0-1
Orthogonal
Grid
Integer
50
H i e r a r c h i c La y o u t e r
Use Hierarchic layout style to highlight the main direction or flow within a diagram. Cyclic
dependencies of shapes will be automatically detected and resolved. Shapes will be placed
4-154
DIAGRAMS BASICS
Laying out
in hierarchically arranged layers. Additionally, the ordering of nodes within each layer is
chosen in such a way, that the number of paths crossings is small.
Orthogonal layout options
Option
Values
Reverse
Boolean
Orientation in
Activity Diagram
True
Minimal Layer
Distance
Integer
40
Minimal Shape
Distance
Integer
30
Minimal Path
Distance
Integer
30
Minimal First
Segment Length
Integer
10
Orientation
Top to
Bottom,
Bottom to
Top, Left to
Right, Right
to Left
Top to
Bottom
Shape
Placement
Linear
Segments,
Polyline,
Simplex,
Pendulum,
Median
Simplex,
Tree
Simplex
4-155
DIAGRAMS BASICS
Laying out
Option
Values
Path Routing
Oblique,
Orthogonal
Orthogonal
Randomization
Rounds
Integer
40
False
True
Boolean
Tr e e La y o u t e r
Tree layouter organizes diagram shapes into a tree structure. Tree layouter might be
applied on shapes that have no undirected cyclic paths between them.
Table 3, Visible Tree layout options
Option
Values
Layout Style
Directed,
Balloon,
HorizontalVertical
Directed
4-156
DIAGRAMS BASICS
Laying out
Option
Values
Boolean
True
Minimal Layer
Distance
Integer
50
Minimal Shape
Distance
Integer
50
Orientation
Port Style
Border
Centered,
Border
Distributed
Border
Centered
True
Directed
Balloon
Root Shape
Position
Preferred Child
Wedge
0-360
340
Preferred Root
Wedge
0-360
360
Minimal Path
Length
Integer
50
Compactness
Factor
0.1-0.9
0.5
Horizontal-Vertical
4-157
DIAGRAMS BASICS
Laying out
Option
Values
Horizontal
Spacing
Integer
20
Vertical Spacing
integer
20
O r g a n i c La y o u t e r
The layouter is well-suited for the visualization of highly connected backbone regions with
attached peripheral ring or star structures. These structurally different regions of a network
can be easily identified by looking at a drawing produced by this layouter.
Organic layout options
Option
Values
Preferred Path
Length
Integer
50
Obey Shape
Size
Boolean
True
Gravity Factor
-0.2-2
Path Attraction
0-2
Activate Tree
Beautifier
True
False
Package Shape
Compactness
0.2
Boolean
0-1
4-158
DIAGRAMS BASICS
Laying out
C i r c u l a r La y o u t e r
Circular Layouter produces layouts that emphasize group and tree structures within a
network. It partitions shapes into groups by analyzing the connectivity structure of the
network. The detected groups are laid out on separate circles. The circles themselves are
arranged in a radial tree layout fashion.
Circular Layouter options
Option
Values
Default
Value
Description
Layout Style
Compact,
Isolated, Single
Cycle
Compact
Minimal Shape
Distance
Integer
100
Auto Circle
Radius
Boolean
True
Fixed Circle
Radius
Integer
200
Preferred Child
Wedge
0-360
340
4-159
DIAGRAMS BASICS
Laying out
Option
Values
Default
Value
Description
Minimal Path
Length
Integer
50
Maximal
Deviation Angle
10-360
100
Compactness
Factor
0.1-0.9
0.5
O r t h o g o n a l Pa t h Rou t e r
This layouter routes paths using only vertical and horizontal line segments, while keeping
the positions of shapes in the diagram fixed. The routed paths usually will not cross any
shapes and not overlap any other paths.
Orthogonal Path layout options
Option
Values
Default
Value
Description
Minimal
Distance
Integer
20
Use Existing
Bends
Boolean
False
Route Only
Necessary
Boolean
False
O r g a n i c Pa t h Ro u t e r
This layouter routes paths using oblique paths style, while keeping fixed positions of shapes
on a diagram. The routed paths usually will not cross any shapes and not overlap any other
paths.
4-160
DIAGRAMS BASICS
Laying out
Values
Default Value
Description
Minimum Path
Distance
Integer
Custom
Minimum
Distance to
Nodes
Integer
10
Route on Grid
Boolean True
Space Driven
Vs. Center
Driven Search
0-1
Local Crossing
Minimization
Boolean True
C l a s s D i a g r a m La y o u t e r
Class diagram layouter uses different layout algorithms to improve class diagram
readability.
Class Diagram layout options
Option
Values
Default Value
Description
Minimal Layer
Distance
Integer
50
Minimal Shape
Distance
Integer
50
Orientation
Top to
Bottom,
Bottom
to Top,
Left to
Right,
Left to
Right
Top to bottom
4-161
DIAGRAMS BASICS
Zooming
Option
Values
Default Value
Description
Compactness
Factor
0-1
Space Driven
Vs. Center
Driven Search
0-1
Build
Generalization
Hierarchies
Boolean
True
False
Build
Containment
Hierarchies
Boolean
False
Boolean
True
Q u i c k D i a g r a m La y o u t f e a t u r e
You may use Quick Layout feature when editing diagrams other that class or sequence.
This feature applies recommended layouter with default options on active diagram.
ZOOMING
Zooming allows you to select a small part of a diagram, zoom into it, and make changes to
the enlarged portion working with a finer level of detail, or gain an overview of a diagram
by zooming it out.
From the View menu or from the diagram shortcut menu, choose Fit in Window
(shortcut keys CTRL+W.)
4-162
DIAGRAMS BASICS
Using Grid
From the View menu or from the diagram shortcut menu, choose Zoom In
(shortcut keys CTRL+NumPad PLUS SIGN (+) or scroll.)
From the View menu or from the diagram shortcut menu, choose Zoom Out
(shortcut keys CTRL+NumPad MINUS SIGN (-) or scroll.)
TIP!
From the View menu or from the diagram shortcut menu, choose Zoom 1:1
(shortcut keys CTRL+NumPad SLASH MARK (/).)
To determine the size of a zoom step, which will be used in zoom operations
1 From the Options menu, choose Environment. The Environment Options dialog
box appears.
2 Open the Diagram pane and change the Zoom Step Size property. The
maximum number is 1.0 (you may zoom a diagram twice.)
NOTE
You may also zoom in or out of the diagram using the zoom
panel in the Browser window. For the detailed description, see
Section Documentation/Zoom Control/Properties on
page 3-96.
U S I N G G R ID
The grid helps you lay out the diagram symbols on the Diagram pane. By default the grid is
in the visible state.
4-163
DIAGRAMS BASICS
Assigning Shortcut Keys
box appears.
2 From the Grid Style drop-down list box, select one of the following style of the
grid:
Dense
Sparse (default)
4-164
DIAGRAMS BASICS
Printing
PRINTING
In MagicDraw, you may print an active diagram, the selected model elements, or several
diagrams. All menu commands for printing you may find in the File menu, use the toolbar
buttons, or the shortcut keys.
Before printing, we suggest to define options of printing in the Print dialog box.
NOTE
If the size of the text is too small, it may be not visible on the printed page.
button.
The Print dialog box contains the Print Range tab, Print Options tab and the Print
Header/Footer tab. See the description in the following sections.
PRINT RANGE TAB
In the Print Range tab, select what you want to print.
4-165
DIAGRAMS BASICS
Printing
Element name
Function
Active Diagram
Selected Symbols
Selected Diagrams
From the Not Empty Diagrams list, select diagrams you want to
print.
Name
Owner
The name of the model element that owns the particular diagram.
Select All
Unselect All
Close
Help
4-166
DIAGRAMS BASICS
Printing
4-167
Element name
Function
Print Background
Show Pages on
Diagram
Fit in Page
The printed diagram fits in one page. If the Fit in Page check box
is cleared, and the Show Pages in Diagram check box is
selected, the gridlines of pages are shown on the diagram pane.
Zoom
Zoom the selected diagram to the size you want to print it.
NOTE
You are not allowed to zoom a diagram if the Fit in
Page check box is selected.
Pages
Page Settings
DIAGRAMS BASICS
Printing
Element name
Function
Print the test page. Set print options in the Print Options dialog
box.
Preview
<
>
Use any text and combine it with these variables box - indication how to insert
some fields in the header/footer.
Customize header group box - prints header. Select the Print Header check box
and type the text you wish to be printed, also choose the desired font.
Customize footer group box - prints footer. Select the Print Footer check box
and type or change the text you wish to be printed also choose the desired font.
By default <$PageNumber$> <$FileName$> <$DiagramName$>
<$Date$> <$Time$> is printed.
4-168
DIAGRAMS BASICS
Model Elements Common in all Diagrams
Button
Text Box
Function
Notation
(X)
(SHIFT+X)
Note
(N)
Note (HTML text)
(SHIFT+N)
Note Anchor
(H)
Constraint
NOTE
To select a
constraint,
right-click the
Note Anchor
button.
(SHIFT+H)
Separator
(W)
Note Anchor
Use a note anchor to relate any symbol to a note. You may change the style of a note
anchor to rectilinear, oblique, or bezier.
For a detailed description on editing the appearance of paths, see Section Drawing
Relationship paths on page 4-129.
4-169
DIAGRAMS BASICS
Model Elements Common in all Diagrams
Constraint path
For two graphical symbols (such as two classes or two associations), the constraint is shown
as a dashed arrow from one element to the other element. The constraint is labeled by the
constraint string (in braces {}). The direction of the arrow is relevant information within the
constraint. The client (tail of the arrow) is mapped to the first position and the supplier (head
of the arrow) is mapped to the second position in the constraint.
Choose <new>. The Constraint Specification dialog box appears. Fill in the
dialog box.
Choose <none>.
Separator
You may use a horizontal separator to rule off different parts of a diagram. Specification of
UML 1.4 does not provide rules for using a separator in diagrams.
From the separator shortcut menu, choose Text Position, and then choose the
text position you need: Left (default), Center, or Right.
From the separator shortcut menu, choose Line Style, and then choose the style
you need: Dashed (default) or Solid.
Documentation
Define the documentation for various documents in the Comment Specification dialog box.
Also for a comment you may define stereotypes, tagged values and constraints.
2005 No Magic, Inc
4-170
DIAGRAMS BASICS
Model Elements Common in all Diagrams
button.
TIP!
4-171
DIAGRAMS BASICS
Model Elements Common in all Diagrams
4-172
UML DIAGRAMS
In software development, the diagram is the equivalent of a blueprint. To meet the various
needs of many parties, we often need several different blueprints of the same system.
Furthermore, ever system is described by many different aspects. For example:
Class diagram
Object diagram
Statechart diagram
Activity diagram
Collaboration diagram
Sequence diagram
Component diagram
Deployment diagram
However, MagicDraw has only 7 diagram buttons in the application. This is done to simplify
the user interface and allow for more flexibility.
Object and collaboration diagrams are supported by MagicDraw collaboration diagram.
However it is possible to draw objects in the class diagram, node and component instances
in the implementation diagram.
Component and deployment diagrams are supported by MagicDraw implementation
diagram which allows you to draw both kinds of diagrams (or mix of them) on the same
canvas.
It possible to distinguish model management diagrams that are supported by MagicDraw
class diagram.
5-174
UML DIAGRAMS
System Views
SYSTEM VIEWS
Most UML literature (Instant UML, UML Toolkit, The Unified Modeling Language
Reference Manual) define more or less similar classification for the system views:
Several kinds of diagrams provide a visual notation for the concepts in each view.
Log i c a l V i e w
The logical view represents both the static and dynamic aspects of a system in terms of class
and objects. In contrast to the use case view, the logical view looks inside the system.
Static structure is displayed on Class and Package diagrams, and the main goal of these
diagrams is to represent a systems class structure: The development of the static structure
relies on abstraction, encapsulation, and uniformity. The class diagram finally results in the
code structure.
The dynamic behavior of the system is displayed on Interaction (sequence and
collaboration), Statechart, and Activity diagrams. It focuses mainly on the interactions that
occur between objects inside a system, activities and work performed by the various parts of
a system, and state changes within a particular object or collaboration. Rather than
defining the participants of the system, it defines how particular use cases are executed,
which provides value for the external user. The dynamic view is concerned about what is
happening inside the system and how those actions impact other participants.
5-175
UML DIAGRAMS
Class Diagram
Pr o c e ss v i e w
The process view represents the division of the system into processes and processors. This
view allows efficient resource usage, parallel execution, and the handling of asynchronous
events from the environment.
The process view is displayed on Component, Deployment and Interaction diagrams.
The process view also is called the concurrency view. The term concurrency view,
however, carries with it a slightly different connotation/ implication. The synchronization of
the thread, object initialization, and other actions are displayed on the same diagrams as
dynamic model elements (sequence, collaboration, state, and activity).
Component view
The component view represents the implementation modules and their dependencies. This
view mainly deals with the development time software structure source code files,
libraries, linking time components, and finally executable components. In fact, the
component view describes the software as it appears in the computer disc, such as files and
directories.
The component view is displayed on component diagrams.
Deployment view
The deployment view represents the physical arrangement of a system, such as computers
and devices (nodes) and how they are connected to each other. In contrast to the
component view, the deployment view is concerned with the physical structure of the system
and the location of the software modules (components) within the system.
The deployment view is displayed on component and deployment diagrams. The mix of
component and deployment diagrams is called the implementation diagram in
MagicDrawTM UML.
CLASS DIAGRAM
A class diagram is a graphic representation of the static structural model. It shows classes
and interfaces, along with their internal structure and relationships. Classes represent types
of objects that are handled in a system. A class diagram does not show temporal
information, it describes only the classification. The instances of those types (objects) are
2005 No Magic, Inc
5-176
UML DIAGRAMS
Class Diagram
instantiated only on the runtime and are represented by an object and interaction
diagrams.
Classes can be related to each other in a number of ways: associated (connected to each
other), dependent (one class depends/uses another class), specialized (one class is a
subtype of another class), or packaged (grouped together as a unit package). A class
diagram does not express anything specific about the relationships of a given object, but it
does abstractly describe the potential relationships of one object to other objects.
A system typically has a number of class diagrams not all classes are inserted into a single
class diagram. A class may have multiple levels of meaning and participate in several class
diagrams.
A class diagram is the logical map of your existing or future source code.
Classes can be grouped into packages. Packages can be nested within other packages. A
package, as an entity, may have all the relationships that can be drawn for a class. Those
relationships are derived from the classes or packages that are nested within two particular
packages (i.e., the relationship between packages reflects a set of relationships between
classes placed in those packages).
5-177
UML DIAGRAMS
Class Diagram
Enumeration
A user-defined data type
whose instances are a
set of user-specified
named enumeration
literals. The literals have
a relative order but no
algebra is defined on
them.
Interface
The description of a
visible behavior of a
class, a component or a
package. Interface with
the suppressed attributes
and operations.
Port
Ports represent
interaction points
between a classifier and
its environment. A port
has the ability to specify
that any requests
arriving at this port are
handled.
Button (hot
key)
Notation
(C)
(K)
(I)
(Shift_F11)
Package
A group of classes and
other model elements.
(P)
5-178
UML DIAGRAMS
Class Diagram
Model element
Subsystem
A subsystem is treated as
an abstract single unit
and groups model
elements by
representing the
behavioral unit in a
physical system.
Model
A model is an
abstraction of a physical
system from a particular
point of view. A model
contains a hierarchy of
packages/subsystems
and other model
elements that describe
the system.
N-ary association
An association among
two or more classes (a
single class may appear
more than once).
5-179
Button (hot
key)
Notation
(Y)
(M)
(O)
UML DIAGRAMS
Class Diagram
Model element
Collaboration
A collaboration
describes how an
operation or a classifier,
like a use case, is
realized by a set of
classifiers and
associations used in a
specific way. The
collaboration defines a
set of roles to be played
by instances and links,
as well as a set of
interactions that define
the communication
between the instances
when they play the roles.
Collaboration may have
internal structure
specified relying on
roles and connectors.
Button (hot
key)
Notation
(Q)
Object
An instance of a class.
(SHIFT+O)
Association
A connection among
classes, which means
that there is also a
connection among
objects of those classes.
Aggregation
An aggregation is an
association that
represents a whole-part
relationship.
Composition
A composition is a form
of aggregation with
stronger ownership and
coincident lifetime of
part with the whole.
(S)
(A)
(F)
5-180
UML DIAGRAMS
Class Diagram
Model element
Containment
Shows a class, package
or other model element
declared within another
model element. Such a
declared class is not a
structural part of the
enclosing class but
merely has scope within
the namespace of the
enclosing class, which
acts like a package
toward the inner class.
Generalization
A relationship between a
more general and a
more specific element.
Realization (realize)
A relationship usually
used between an
interface and
implementation class.
Button (hot
key)
Notation
(SHIFT+C)
(G)
(R)
Realization
Relationship between
class and interface.
(E)
5-181
UML DIAGRAMS
Class Diagram
Model element
Dependency
Indicates a semantic
relationship between
two or more model
elements. It relates
model elements
themselves and does not
require a set of
instances for its
meaning.
NOTE
Select by right-clicking
the kind of relationship:
dependency,
abstraction, usage,
binding dependency,
permission, merge, or
import.
Button (hot
key)
Notation
(D)
(T)
(U)
(B)
(J)
Link Attribute
Visual tie between parts
of association class
association part and
class part.
(L)
Link
A connection between
two or more objects.
(SHIFT+L)
Stereotype
(SHIFT+S)
5-182
UML DIAGRAMS
Class Diagram
Classes
A class is drawn as a solid-outline rectangle with three compartments separated by
horizontal lines. The top name compartment holds the class name and other general
properties of the class (including stereotype); the middle list compartment holds a list of
attributes; the bottom list compartment holds a list of operations. The attribute and
operation compartments are optional and you may suppress them.
A class is the descriptor for a set of objects with similar structure, behavior, and
relationships. The model is concerned with describing the intention of the class, that is, the
rules that define it. The run-time execution provides its extension, that is, its instances.
Classes are declared in class diagrams and used in most other diagrams. UML provides a
graphical notation for declaring and using classes, as well as a textual notation for
referencing classes within the descriptions of other model elements.
A class represents a concept within the system being modeled. Classes have data structure,
behavior, and relationships to other elements. The name of a class has scope within the
package in which it is declared and the name must be unique (among class names) within
its package.
WORKING WITH CLASSES
General information about working with shapes is offered in Chapter 4, "Diagrams Basics."
All options associated with a class can be set in the Class Specification dialog box.
Class Specification dialog box
5-183
UML DIAGRAMS
Class Diagram
Refer to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Visibility
Set general
information about
the class
Template
Parameters
A template is the
descriptor for a
class with one or
more unbound
formal
parameters.
Active
Name
Type
Default Value
Edit
Add
Remove
Inner Elements
Name
Add another class,
Edit
use case,
interface, or/and
collaboration to a
class
Ports
Function
Add
Remove
Default Name
Type
Edit
Remove
5-184
UML DIAGRAMS
Class Diagram
To analyze a class
From the class shortcut menu, choose Tools, and then Analyze. For a detailed
description, see Section Creating Setters / Getters on page 7-438.
To generate operations for setting or getting private data to the selected class
From the class shortcut menu, choose Tools and then Create Setters/Getters. For
a detailed description, see Section Creating Setters / Getters on page 7-438.
5-185
UML DIAGRAMS
Class Diagram
Interface
An interface is a specifier for the externally-visible operations of a class, component, or
other classifier (including subsystems) without specification of internal structure. Each
interface often specifies only a limited part of the behavior of an actual class.
The set of interfaces realized by a classifier are its provided interfaces, which represent the
obligations that instances of that classifier have to their clients. They describe the services
that the instances of that classifier offer to their clients.
To display provided interface, from class to interface draw realize relationship (attributes
and operations of the interface should be suppressed).
Interfaces may also be used to specify required interfaces, which are specified by a usage
dependency between the classifier and the corresponding interfaces. Required interfaces
specify services that a classifier needs in order to perform its function and fulfill its own
obligations to its clients.
To display required interface, from class to interface draw usage relationship (attributes and
operations of the interface should be suppressed)
Working with interface is similar to working with classes. For more information, see Section
Working with classes on page 5-183.
General information about working with shapes is offered in Chapter 4, "Diagrams Basics."
All options associated with a interface can be set in the Interface Specification dialog box.
5-186
UML DIAGRAMS
Class Diagram
Refer to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Visibility
Set general
information about
the interface
Function
Template
Parameters
A template is the
descriptor for an
interface with one
or more unbound
formal
parameters.
5-187
Name
Type
Default Value
Edit
Add
Remove
UML DIAGRAMS
Class Diagram
Tab name
Box name
Inner Elements
Name
Add class, use
Edit
case, interface,
enumeration, data
type,
programming
language data
type or/and
Add
collaboration to
an interface
Remove
Function
Model element type and name.
The corresponding (class, use case, interface,
enumeration, data type, programming
language data type, or collaboration)
specification dialog box appears. Edit the
selected model element in the dialog box.
The corresponding (class, use case, interface,
enumeration, data type, programming
language data type, or collaboration)
specification dialog box appears. Define the
selected model element in the dialog box.
Remove the selected model element from an
interface.
Attribute
An attribute is a named property of a class that describes a range of values that can be held
by instances of that class.
Double-click the selected class or choose Specification from the class shortcut
menu. The Class Specification dialog box appears. Click the Attributes tab and
then click the Add button. The Attribute Specification dialog box appears. Define
a new attribute and click OK.
Choose the Insert New Attribute from the class shortcut menu. Type attribute
name directly on the class shape.
In the Browser tree, choose already created class. From the class item shortcut
menu, choose New and then choose Attribute.
dialog box.
2 In the Attributes tab, double-click the desired attribute in the list, or click the Edit
or Add button.
In the Association End Role Specification, and Association End Role
Specification dialog boxes, Details tab, Qualifiers group box, click the Add or
Edit button.
5-188
UML DIAGRAMS
Class Diagram
Refer to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Options
General
Class
Set general
information
for the
Type
attribute
5-189
Function
Shows a class that contains the current attribute. You may
not change the value of the Class box. It is automatically
defined when you create an attribute.
Shows attributes type. It can be another project class or
primitive type such as int or double or other. Choose the
type from the list or add new one by clicking the New
button.
Type Modifier
Changeability
Attributes changeability:
Changeable No restrictions on modification.
Frozen The value may not be altered after the object is
instantiated and its values initialized. No additional values
can be added to a set. @ sign is added.
AddOnly Meaningful only if the multiplicity is not fixed to a
single value. Additional values can be added to the set of
values, but once created, a value may not be removed or
altered.
2005 No Magic, Inc.
UML DIAGRAMS
Class Diagram
Tab name
Options
Function
Initial value
Multiplicity
Visibility
Scope
5-190
UML DIAGRAMS
Class Diagram
This command is visible only if one or more attribute types are other model
classes.
tree.
2 Type a new name.
Change an attribute name in the Attribute Specification dialog box.
TIP:
Choose the type of an attribute from the Type drop-down list box in the Attribute
Specification dialog box.
Type a colon : and the name of the type of an attribute just after the attribute
name on the diagram pane. If you specify a nonexistent type of an attribute, a
new class is created.
There are available two kinds of lists for selecting a type for an attribute. If in the
Environment Options dialog box, General pane you will select the Use List for
Type Select check box, all available classifiers will be displayed in the list, if you
unselect this check box, the hierarchy of available classifiers will be displayed in
the list.
5-191
UML DIAGRAMS
Class Diagram
Function
Public +
Package ~
Protected #
Private -
Classifier.)
Function
changeable
No restrictions on modification.
frozen
The value may not be altered after the object is instantiated and its
values initialized. No additional values can be added to a set. @
sign is added.
addOnly
Choose changeable, frozen, or addOnly from the drop-down list box in the
Attribute Specification dialog box.
5-192
UML DIAGRAMS
Class Diagram
Operation
Entries in the operation compartment are strings that show operations defined on classes,
as well as operations supplied by classes. An operation is a service that an instance of the
class can be requested to perform. It has a name and a list of arguments.
Usually class attributes are accessed through operations. Operations are used to perform
specific actions, such as system calls, utility functions, and queries. The operation signature
provides all information needed to use that operation.
Double-click the selected class or choose Specification from the class shortcut
menu. The Class Specification dialog box appears. Click the Operations tab
and then click the Add button. The Operation Specification dialog box
appears. Define a new operation and click OK.
Choose the Insert New Operation from the class shortcut menu. Type operation
name directly on the class shape.
In the Browser tree, choose already created class. From the class item shortcut
menu, choose New and then choose Operation.
5-193
UML DIAGRAMS
Class Diagram
Refer to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Set general
information for
the operation
Class
Return Type
Return Type
Modifier
Concurrency
Query
5-194
UML DIAGRAMS
Class Diagram
Tab name
Parameters
A parameter is an
unbound variable
that can be
changed, passed,
or returned.
Box
Function
Visibility
Scope
Name
Type
Default value
Direction kind
Up
Down
Edit
Add
Remove
tree.
2 Type a new name.
Change an operation name in the Operation Specification dialog box.
5-195
In the Attribute Specification dialog box, the Return Type drop-down list box,
choose the return type of an operation .
UML DIAGRAMS
Class Diagram
Type a colon : and the name of the type of an operation just after the
operation name on the diagram pane. If you specify a nonexistent type of an
operation, a new class is created.
a parameter and click the Edit or Add button. The Parameter Specification
dialog box appears.
Type a parameter text (in parenthesis) directly on a diagram.
Select an operation in the Browser tree, choose New from its shortcut menu and
choose Parameter. The Parameter Specification dialog box appears.
5-196
UML DIAGRAMS
Class Diagram
Refer to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Operation
Set general
information about Type
the parameter
Type Modifier
Default Value
Direction kind
Function
Abstract
Leaf
Root
5-197
UML DIAGRAMS
Class Diagram
Function
Public +
Package ~
Private -
Protected #
Protected.
Operation visibility is shown in the operation signature.
Function
Sequential
Guarded
Concurrent
Choose the concurrency type in the Concurrency drop-down list box in the
Operation Specification dialog box.
5-198
UML DIAGRAMS
Class Diagram
shortcut menu. The Class Specification dialog box appears. Click the Template
Parameters tab.
2 To add or edit a parameterized class, click the Add button. The Template
Parameter Specification dialog box appears. Type the name of the parameter,
choose the type from the Type drop-down list box and set the default value by
selecting a model element in the Select Model Element dialog box.
3 To remove the selected parameterized class, click the Remove button.
Tab name
Box name
Function
General
Set general
information about
the template
parameter
Type
Default Value
5-199
UML DIAGRAMS
Class Diagram
Po r t
Ports represent interaction points between a classifier and its environment.
The interfaces associated with a port specify the nature of the interactions that may occur
over a port. The required interfaces of a port characterize the requests which may be made
from the classifier to its environment through this port. The provided interfaces of a port
characterize requests to the classifier that its environment may make through this port.
A port has the ability to specify that any requests arriving at this port are handled.
Class model element and Component model elements may have any number of Ports.
When port is created, new class for port definition is created in the same package as source
class. Port class name by default is Port_<incremental number>.
Define a port in the Port Specification dialog box.
Port Specification dialog box
5-200
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Set general
information for
the port
Type
Multiplicity
Is Behavior
Is Service
Edit
Name
Edit
Data types
A data type is a type whose values have no identity; that is, they are pure values.
Data type is a classifier and inherits the general features of the classifier: visibility,
generalizable element properties, and operations.
MagicDraw provides the following predefined data types: byte, int, boolean, char, float,
double, short, void, long.
5-201
UML DIAGRAMS
Class Diagram
You may also create Enumeration, Primitive, and Programming Language data types.
NOTE:
From the Browser: Choose New from the class or New Element from the
package, subsystem, or model shortcut menu, and then choose Data Type,
Enumeration, Primitive, or Programming Language Data Type.
In the Class, Package, Subsystem, and Model Specification dialog boxes, Inner
Elements tab, click Add and select a data type you want to create.
You may create an enumeration by clicking the Enumeration button from the
class diagram toolbar:
5-202
UML DIAGRAMS
Class Diagram
Data Type, Primitive, or Programming Language Data Type Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Set general
information
about the data
type
Visibility
Expression
Expression is expressed in data types particular
NOTE: Expression programming language.
is available only for
Programming
Language Data
Type.
ENUMERATION
Enumeration defines a kind of data type whose range is a list of predefined values, called
enumeration literals. An Enumeration may have operations, but they must be pure functions
(this is the rule for all data type elements).
Define an enumerations in the Enumeration Specification dialog box.
5-203
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Visibility
Set general
information about
the enumeration
Function
Enumeration
Literals
An enumeration
literal defines an
element of the
run-time extension
of an enumeration
data type.
Name
Edit
Add
Remove
5-204
UML DIAGRAMS
Class Diagram
enumeration literal.
Choose Insert New Enumeration Literal command from the Enumeration
shortcut menu.
PRIMITIVE
A primitive defines a predefined data type without possessing any relevant UML
substructure; that is, it has no UML parts. A primitive data type may have an algebra as well
as operations defined outside of UML (for example, mathematically). Primitive data types
used in UML include Integer, Unlimited Integer, and String.
PROGRAMMING LANGUAGE DATA TYPE
A data type is a type whose values have no identity (i.e., they are pure values). A
programming language data type is a data type specified according to the semantics of a
particular programming language, using constructs available in that language. There are a
wide variety of programming languages and many of them include type constructs not
included as UML classifiers. In some cases, it is important to represent those constructs so
that their exact form in the programming language is available.
Because they are dependent on particular languages, they are not portable among
languages (except by agreement among the languages) and they do not map into other
UML classifiers. Many or most programming language types can be directly represented
using other UML classifiers, and such representation makes available deeper semantic
analysis.
A programming language data type may omit its name. Two programming language data
type elements without names are not considered equivalent.
D e s i g n Pa t t e r n s
In MagicDraw, you may create and edit design patterns for the selected class. The detailed
description of templates is in the Design Patterns of Reusable Object-Oriented Software.
5-205
UML DIAGRAMS
Class Diagram
For a detailed description of this dialog box, see Section Pattern Wizard on page 7-432.
Choose Presentation Options from the class shortcut menu. The following
choices are available in the Presentation Options submenu.
Class presentation options you may also define in the Project Options dialog
box. For a detailed description of this dialog box, see Section Project Options
on page 3-51.
5-206
UML DIAGRAMS
Class Diagram
Command
Show Operations Signature Shows operation signature (arguments, return value and
etc).
Show Full Classifier Type
Suppress Attributes
Suppress Operations
Show Only Public Members Shows only public attributes and operations.
Show all Members
5-207
UML DIAGRAMS
Class Diagram
Command
Show Stereotypes
Show Constraints
Show Owner
Pa c k a g e s
A package groups together classes and other model elements. All types of UML model
elements can be organized into packages. Each diagram must be owned by one package
and packages themselves can be nested within other packages. Special kinds of packages
are subsystems and models.
Packages may have dependency, generalization, realize, containment, and association
relationships. All relationships are usually derived from the relationships between the
classes that are placed inside those packages.
WORKING WITH PACKAGES
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected package in the Package Specification dialog box.
5-208
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
Inner Elements
Add another
model element or
a diagram to a
package
Name
Edit
Add
Remove
5-209
UML DIAGRAMS
Class Diagram
From the package shortcut menu, choose Header Position and then choose Top
or In Tab.
Choose Symbol(s) Properties from the package shortcut menu, and choose
Header Position Top or In Tab in the Properties dialog box.
Subsystem
A subsystem is treated as an abstract single unit. It groups model elements by representing
the behavioral unit in a physical system. A subsystem is defined as a package, and it
includes operations, specification elements, and realization elements. Specification
elements define unit behavior and interaction with other subsystems. Specification elements
include interfaces, use cases, constraints, relationships between use cases, etc. Realization
elements realize subsystem behavior. Realization elements include various kinds of
classifiers and their relationships.
A subsystem is presented as a package with a fork symbol placed in the upper right corner
of the small rectangle. The large rectangle has three compartments. One is for operations,
one for specification elements, and one for realization elements.
A subsystem is defined as a package it has package properties in the Subsystem
Specification dialog box. For a detailed description of packages, see Section Packages
on page 5-208.
5-210
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Set general
information
about the
subsystem
Instantiable
Inner Elements
Name
Add another
model element or
Edit
a diagram to a
subsystem
Add
5-211
UML DIAGRAMS
Class Diagram
Tab name
Box name
Function
Remove
Additional operations can be added to a subsystem. For more information about how to
define operations, see Section Operation on page 5-193.
Open the Subsystem Specification dialog box. Click the Operations tab. Click
the Add button. The Operation Specification dialog box appears.
From subsystem shortcut menu in the Browser, choose New Element and then
choose Operation.
5-212
UML DIAGRAMS
Class Diagram
Model
A model is an abstraction of a physical system from a particular point of view. A model
contains a hierarchy of packages/subsystems and other model elements that describe the
system.
A model is presented as a package with a small triangle in the upper right corner of the
large rectangle. The triangle can be shown in the tab.
A model is defined as a package it has package properties - in the Model Specification
dialog box. For a detailed description of packages, see Section Packages on
page 5-208.
Model Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section..
Tab name
Box
Inner Elements
Name
Add other model
Type
elements and
diagrams to a
Edit
model
5-213
Function
A name of an inner model element that is added to a model.
The type of the inner element.
The corresponding (class, use case, actor, interface,
component, node, data type, collaboration, subsystem,
model, package) specification dialog box appears. Edit the
selected model element in the dialog box. Or the Type Name
of the corresponding diagram (class diagram, use case
diagram, collaboration diagram, sequence diagram, state
diagram, activity diagram, and/or implementation diagram)
dialog box appears. Edit the name of the selected diagram.
UML DIAGRAMS
Class Diagram
Tab name
Box
Function
Add
Remove
Collaboration
A collaboration describes how an operation or a classifier (like a use case) is realized by a
set of classifiers and associations used in a specific way. The collaboration defines a set of
roles to be played by instances and links, as well as a set of interactions that define the
communication between the instances when they play those roles.
Define a collaboration in the Collaboration Specification dialog box.
Collaboration Specification dialog box
5-214
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Represented
Set general
information about
the collaboration
Classifier Roles
Name
Contains the list
of collaborations
Classifier Name
classifier roles and
buttons for editing
this list.
Edit
Instances
Contains the list
of collaboration
instances and
buttons for
managing this list.
Add
Remove
Name
Assigned
Classifiers
Edit
Add
Remove
NOTE
In the Collaboration Specification dialog box, Classifier Roles tab, click the Add
button. Define a classifier role in the Classifier Role Specification dialog box.
From the collaboration shortcut menu in the Browser, choose New, and then
choose Classifier Role. Type a name of the classifier role and modify it in the
Classifier Role Specification dialog box.
You may edit the assigned classifier role in the Collaboration Specification dialog
box, Cllassifier Roles tab.
In the Collaboration Specification dialog box, Instances tab, click the Add
button. Define an instance in the Instance Specification dialog box.
From the collaboration shortcut menu in the Browser, choose the New, and then
choose Instance. Type a name of the instance and modify it in the Instance
Specification dialog box.
NOTE
5-215
UML DIAGRAMS
Class Diagram
You may edit the assigned instance in the Collaboration Specification dialog box,
Instances tab.
Generalization
Generalization is the relationship from the child element (the more specific element, such
as a subclass) to the parent (the more general element, such as a superclass) that is fully
consistent with the first element and that provides additional information. Generalization is
used between elements of the same kind, such as classes, packages, use cases, but never
for instances, such as an object. MagicDraw is not yet adapted to draw generalization
between associations.
A generalization is shown as a solid-line path from the child element (the more specific
element, such as a subclass) to the parent element (the more general element, such as a
superclass), with a large hollow triangle at the end of the path where it meets the more
general element. Generalization lines can be combined into trees.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the generalization in the Generalization Specification dialog box.
5-216
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Parent Element
Set general
information about
the generalization
relationship
Child Element
Function
The name of the parent element. To edit this element,
click the ... button. The appropriated Specification
dialog box appears.
Draw a generalization path between the child element and the parent element.
Click the generalization path button on the diagram toolbar.
Click the other child shape.
Drag the path to the other generalization path and drop it there.
Choose Make Sub Tree from the parent class shortcut menu.
Choose Make Sub Tree from the parent package shortcut menu.
1
2
3
4
5-217
UML DIAGRAMS
Class Diagram
NOTE
From the generalization path shortcut menu, choose Remove From Tree.
This command is available if the same tree contains the selected generalization
path.
GENERALIZABLE ELEMENTS
A generalizable element is a model element that may participate in a generalization
relationship.
Name
Function
Abstract
Leaf
Root
To define a generalizable model element (class, package, use case, etc.) as abstract,
leaf, or root
1 Open the corresponding Specification dialog box.
2 Select the Abstract, Leaf, and/or Root check box(es) in the General tab.
Association
An association in class diagrams represents the semantic relationship between two or more
classifiers, which specifies connections between their instances. An association relationship
is the most general of all relationships and the most semantically weak.
An association in use case diagrams represents the participation of an actor in a use case,
i.e., when instances of the actor and instances of the use case communicate with each
other. This is the only relationship between actors and use cases. Sometimes an association
relationship is called communication association.
An association is drawn as a solid path connecting two classifier symbols.
2005 No Magic, Inc
5-218
UML DIAGRAMS
Class Diagram
For general information about working with symbols, see Chapter 4, "Diagrams Basics."
Specify an association in the Association Specification dialog box.
Association Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Set general
information about
the association
Association End A
Function
Name
Multiplicity
Element A
Association End B
Name
5-219
UML DIAGRAMS
Class Diagram
Tab name
Box
Function
Multiplicity
Element B
path.
ASSOCIATION END
An association end is simply an end of an association where it connects to a classifier. It is
part of the association, not part of the classifier. Each association has two or more ends. An
association end is not a separable element it is just a mechanical part of an association.
appears.
2 Click the Name button in the Association End A or B group box. A or B
depends on which classifier playing role you wish to define (class A association path target, class B source).
From the association end shortcut menu, choose Specification.
5-220
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
5-221
Tab name
Box
Function
General
Set general
information
about the
association end
Element
Initial Value
Multiplicity
UML DIAGRAMS
Class Diagram
Tab name
Box
Function
Ordering
Type Modifier
Scope
Visibility
Aggregation
Kind
5-222
UML DIAGRAMS
Class Diagram
Tab name
Box
Function
Changeability
Navigable
Qualifiers
Name
Define qualifiers
of the
Type
association end.
A qualifier is an
attribute of an
Initial value
association end.
Edit
Add
Remove
5-223
Composite).
From the association shortcut menu, choose Role A of (class name) or Role B of
(class name), and from an Aggregation Kind drop-down list box, choose none,
aggregate, or composite.
UML DIAGRAMS
Class Diagram
NOTE
Choose Role A of (class name) or Role B of (class name) from the association
shortcut menu, and then select/clear the Navigable check box.
private.
box.
Open the Association Specification dialog box and from the Multiplicity dropdown list box, choose or type the multiplicity value for the desired association
end.
From the association shortcut menu, choose Role A of (class name) or Role B of
(class name), and from the Multiplicity drop-down list box, choose the
multiplicity value (1, *, 0..*, etc.)
5-224
UML DIAGRAMS
Class Diagram
Function
Changeable
No restrictions on modification.
Frozen
The value may not be altered after the object is instantiated and
its values initialized. No additional values can be added to a
set. @ sign is added.
AddOnly
box.
Define a qualifier.
3 To remove a qualifier, click the Remove button.
In the Association End Specification dialog box, you may also define association end
scope, type modifier, or set association end as ordered.
Re a l i z a t i o n
A realization relationship is a relationship between two descriptions of the same thing
between specification and its implementation but at different levels of abstraction. A
realization is used to show an interface implementation. The realization means that the
client element must support all the behavior of the supplier element but need not match its
structure or implementation.
Realization relationships are drawn as a dashed line with a solid triangular arrowhead (a
dashed generalization symbol). The client (the one at the tail of the arrow) supports at
least all of the operations defined in the supplier (the one at the arrowhead), but without the
necessity of supporting the data structure of the supplier (attributes and associations).
5-225
UML DIAGRAMS
Class Diagram
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Realization paths can be grouped in the tree. This feature makes a diagram appear both
more structural and understandable.
NOTE
Select the realization and choose the Remove From Tree command from the
path shortcut menu.
Select tree head and choose the Ungroup Tree command from the tree shortcut
menu.
To specify the selected realization path in the Abstraction Specification dialog box
Dependency
A dependency indicates a semantic relationship between two model elements (or two sets of
model elements). It relates the model elements themselves and does not require a set of
instances for its meaning. It indicates a situation in which a change to the supplier (target)
element may require a change to the client (source) element in the dependency.
A dependency is shown as a dashed arrow between classes or packages. The model
element at the tail of the arrow (the client element) depends on the model element at the
arrowhead (the supplier element). The arrow can be labeled with an optional stereotype
and an optional individual name.
NOTE
You may also draw a dependency between a class and other class elements, such
as attributes and operations.
Since version 6.0 you may draw a dependency between paths.
5-226
UML DIAGRAMS
Class Diagram
For more general information about working with the symbols, see Chapter 4, "Diagrams
Basics."
ABSTRACTION
An abstraction is a Dependency relationship that relates two elements or sets of elements
that represent the same concept at different levels of abstraction or from different
viewpoints.
Define an abstraction in the Abstraction Specification dialog box.
Dependency and its kinds Specification dialog boxes
Abstraction, usage, dependency, and permission relationships are defined in the same
dialog box. Differs from one another only corresponding name and different predefined
stereotypes.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Function
BINDING DEPENDENCY
A binding is a relationship between a template and a model element generated from the
template. It includes a list of arguments matching the template parameters. The template is
a form that is cloned and modified by substitution to yield an implicit model fragment that
behaves as if it were a direct part of the model. A Binding must have one supplier and one
client; unlike a general Dependency, the supplier and client may not be sets.
5-227
UML DIAGRAMS
Class Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Initialized
Arguments
The list of the
template
parameters
attached to the
class.
Function
Client Element
Name
Type
Default value
Instantiated
Edit
PERMISSION
Permission is a kind of dependency. It grants a model element permission to access
elements in another namespace.
5-228
UML DIAGRAMS
Class Diagram
Define a permission relationship in the Permission Specification dialog box. For a detailed
description of this dialog box, see Section Dependency and its kinds Specification dialog
boxes on page 5-227.
USAGE
A usage is a relationship in which one element requires another element (or set of elements)
for its full implementation or operation. The relationship is not a mere historical artifact, but
an ongoing need; therefore, two elements related by usage must be in the same model.
Define a usage relationship in the Usage Specification dialog box. For a detailed
description of this dialog box, see Section Dependency and its kinds Specification dialog
boxes on page 5-227.
MERGE
A package merge is a directed relationship between two packages, that indicates that the
contents of the two packages are to be combined. It is dependency relation with applied
stereotype <<merge>>.
Define a merge relationship in the Dependency Specification dialog box. For a detailed
description of this dialog box, see Section Dependency and its kinds Specification dialog
boxes on page 5-227.
IMPORT
A package import is a relationship between an importing namespace and a package,
indicating that the importing namespace adds the names of the members of the package to
its own namespace. It is dependency relation with applied stereotype <<import>>.
Define an import relationship in the Dependency Specification dialog box. For a detailed
description of this dialog box, see Section Dependency and its kinds Specification dialog
boxes on page 5-227
5-229
UML DIAGRAMS
Use Case Diagram
Containment
A containment shows a class, package or other model element declared within another
model element. Such a declared class is not a structural part of the enclosing class but
merely has scope within the namespace of the enclosing class, which acts like a package
toward the inner class.
U S E C A S E D I A G RA M
A use case is a description of the functionality (a specific usage of a system) that a system
provides. The use case descriptions may exist in textual form (simple table), where the use
case diagram provides additional information about the relationship between use cases
and external users. The diagram also allows definition of the systems boundary.
Use cases are described only as viewed externally by the user (a systems behavior as the
user perceives it), and do not describe how the functionality is provided inside the system.
Use cases are not object oriented, but they are included in the UML to simplify the
approach of the projects lifecycle -- from specification to implementation.
5-230
UML DIAGRAMS
Use Case Diagram
Subsystem
A subsystem is treated as an
abstract single unit and groups
model elements by representing
the behavioral unit in a physical
system.
System Boundary
Another representation of a
package. A system boundary
element consists of use cases
related by exclude or include (uses)
relationships.
5-231
Button
(hot key)
Notation
(A)
(U)
(P)
(Y)
(B)
UML DIAGRAMS
Use Case Diagram
Element
Collaboration
A collaboration describes how an
operation or a classifier, like a use
case, is realized by a set of
classifiers and associations used in
a specific way. The collaboration
defines a set of roles to be played
by instances and links, as well as a
set of interactions that define the
communication between the
instances when they play the roles.
Association
The participation of an actor in a
use case, i.e. instances of the actor
and instances of the use case
communicate with each other. This
is the only relationship between
actors and use cases.
Extend
An extend relationship from use
case A to use case B indicates that
an instance of use case B can be
augmented (subject to specific
conditions specified in the
extension) by the behavior specified
by A. The behavior is inserted at the
location defined by the extension
point in B which is referenced by the
extend relationship.
Include
An include (uses) relationship from
use case A to use case B indicates
that an instance of the use case A
will also contain the behavior as
specified by B. The behavior is
included at the location which
defined in A.
Dependency
Indicates a semantic relationship
among two or more model
elements.
Button
(hot key)
Notation
(Q)
(S)
(E)
(C)
(D)
5-232
UML DIAGRAMS
Use Case Diagram
Element
Button
(hot key)
Generalization
A relationship between a more
general and a more specific
element.
(G)
Realization
A realization relationship between
a specification element and its
implementation.
(R)
Containment
Shows a class, package or other
model element declared within
another model element. Such a
declared class is not a structural
part of the enclosing class but
merely has scope within the
namespace of the enclosing class,
which acts like a package toward
the inner class.
Notation
SHIFT+
C
Actors
An actor represents any external user working with a system. An actor can be a human,
another system or some executable process. An actor requires some task solutions from a
system. This task is represented as a use case.
An actor is shown as a stick man figure with the name below the figure. If attributes and
operations are unsuppressed, an actor is shown as a class with a stick man figure in the
upper right corner.
WORKING WITH ACTORS
General information about working with shapes is offered in Chapter 4, "Diagrams Basics."
Define an actor in the Actor Specification dialog box.
5-233
UML DIAGRAMS
Use Case Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements.
From the actor shortcut menu, choose Presentation Options, and then
select/clear the Suppress Attributes and Suppress Operation check boxes.
From the actor shortcut menu, choose Symbol(s) Properties. The Properties
dialog box appears. Select/clear the Suppress Attributes and Suppress
Operation check boxes.
From the Options menu, choose Project. The Project Options dialog box
appears. Select an actor and select/clear the Suppress Attributes and Suppress
Operation check boxes. Click Apply, if you want to apply changes for other
already created actors.
To analyze an actor
From the actor shortcut menu, choose Tools, and then Analyze. For a detailed
description, see Section Tools for Analysis on page 7-417.
To generate operations for setting or getting private data to the selected class
From the actor shortcut menu, choose Tools and then Create Setters/Getters. For
a detailed description, see Section Creating Setters / Getters on page 7-438.
5-234
UML DIAGRAMS
Use Case Diagram
Use Cases
A use case represents a typical interaction between a user and a system. It captures some of
the functionality and data that the user works with. A use case is a classifier representing a
coherent unit of functionality provided by a system, a subsystem, or a class. This unit of
functionality is manifested by sequences of messages exchanged among the system and
one or more outside interactors (called actors) together with actions performed by the
system.
An extension point is a reference to one location within a use case where action sequences
from other use cases can be inserted. Each extension point has a unique name within a use
case and a description of the location within the behavior of the use case.
A use case is shown as an ellipse containing the name inside. Extension points are listed in
a compartment of the use case with the heading extension points.
Define the selected use case in the Use Case Specification dialog box.
5-235
UML DIAGRAMS
Use Case Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Load Profile
Diagrams
Type
The list of the diagrams
Name
in which the use case
participates. Create or Edit
assign a diagram
within a use case.
Add
Extension Points
Remove
Name
Edit
Add
Remove
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
5-236
UML DIAGRAMS
Use Case Diagram
From the use case shortcut menu, choose Insert New Extension Point.
From the use case shortcut menu in the Browser, choose New Element, and then
choose Extension Point. Type the name of the extension point.
1
2
3
4
TIPS:
You may create an extension point directly on a diagram: Draw an extension path
between two use cases, and then in the message window click YES. The extension
point is being created. Specify the name of an extension point.
You may define a use case as abstract, leaf, or root (for the detailed description,
see Section Generalizable elements on page 5-218.)
Tag Defitions
Conditions
PostCondition
PreCondition
Description
Goal
Implementation Issues
Non Functional Requirements
Notes
Flow of Events
Identity
Author
Date
Priority
Other
Assumption
Out-standing Issue
IMPORTANT
5-237
UML DIAGRAMS
Use Case Diagram
Tag definitions from UseCase Description profile are not visible on diagrams,
only in generated reports. The detailed description about reports, see in Section
Reports on page 7-386. For the detailed description of working with tag
definitions, see in Section Tag definitions on page 5-334.
Re l a t i o n s h i p s i n U s e C a s e d i a g r a m
There are several standard relationships among use cases or between actors and use cases.
ASSOCIATION
For more on defining associations, see Section Association on page 5-218.
The participation of an actor in a use case, i.e. instances of an actor and a use case
communicate with each other. This is the only relationship between actors and use cases.
Sometimes an association relationship is called communication association.
EXTEND
An extend relationship from use case A to use case B indicates that an instance of use case
B can be augmented (subject to specific conditions specified in the extension) by the
behavior specified by use case A. The behavior is inserted at the location defined by the
extension point in B which is referenced by the extend relationship.
Define extend relationship in the Extend Specification dialog box.
5-238
UML DIAGRAMS
Use Case Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Base
Set general
information about
the extend
relationship
Function
The base Use Case Specification dialog box appears.
Extension
Condition
Extension Points
Assign
Select the
extension points to
be assigned on
Unassign
the extend
relationship
UML DIAGRAMS
Use Case Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Use case
Set general
information about
the extension
point
Behavioral
Represents a
linkage of an
extension point to
other model
element or
diagram.
Link to
Type
Owner
Add
Remove
INCLUDE
An include relationship from use case A to use case B indicates that an instance of the use
case A will also contain the behavior as specified by B. The behavior is included at the
location defined in use case A.
Define extend relationship in Include Specification dialog box.
5-240
UML DIAGRAMS
Use Case Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Base
Set general
information about
the include
relationship
Addition
Function
The base Use Case Specification dialog box appears.
GENERALIZATION
For more on defining generalizations, see Section Generalization on page 5-216.
A generalization from use case A to use case B indicates that A is a specialization of B.
DEPENDENCY
For more on defining dependencies see Section Dependency on page 5-226.
A dependency indicates a semantic relationship between two model elements (or two sets of
model elements). It relates the model elements themselves and does not require a set of
instances for its meaning. It indicates a situation in which a change to the target element
may require a change to the source element in the dependency.
REALIZATION
For more on defining realizations see Section Dependency on page 5-226
CONTAINMENT
For more on defining containment see Section Dependency on page 5-226
5-241
UML DIAGRAMS
Collaboration Diagram
COLLABORATION DIAGRAM
Collaboration diagram shows an interaction organized around roles. A collaboration
diagram presents a collaboration that contains a set of instances, as well as their required
relationships given in a particular context. The diagram also presents an interaction that
defines a set of messages specifying the interaction between the classifier roles within a
collaboration to achieve the desired result.
A collaboration diagram is given in two different forms: at the instance level or at the
specification level; it shows either Instances, Links, and Stimulus, or ClassifierRoles,
AssociationRoles, and Messages.
Instance level
The instance level (or context) is defined in terms of a static structure of instances and the
relationships between them. Instances have to be assigned to a classifier: either to a class
(object), a use case (use case instance), or an actor (actor instance). The structural part
(more precisely the representation of it) is sometimes called object diagram.
S p e c i fi c a t i o n l e v e l
At the specification level, the diagram shows behavioral elements - ClassifierRoles,
AssociationRoles - and Messages among them. Behavioral elements are dynamic
interactions that show sequence of messages exchanged by objects over time.
A collaboration diagram shows objects interactions organized around the objects and their
relationships to each other. The 3D interaction model shows that the collaboration diagram
is the model projection to the bottom.
5-242
UML DIAGRAMS
Collaboration Diagram
5-243
UML DIAGRAMS
Collaboration Diagram
Button
(hot key)
Notation
(I)
(O)
(U)
(B)
Link
An instance of an
association between
classifiers. Every link among
instances of particular
classifiers should have
corresponding association
between corresponding
classifiers.
Link to Self
An instance of association.
Self link for self-calls. It
begins and ends on the
same instance.
Classifier Role
A classifier role is a specific
role played by a participant
in a collaboration. It
specifies a restricted view of
a classifier, defined by what
is required in the
collaboration.
Association Role
Association roles describe
the required links between
the instances, i.e. a subset
of the existing links.
(L)
(S)
(C)
(A)
5-244
UML DIAGRAMS
Collaboration Diagram
Element
Button
(hot key)
Message / Stimulus
A stimulus is a
communication between
two instances that conveys
information with the
expectation that action will
ensue. A stimulus will cause
an operation to be invoked,
raise a signal, or an
instance to be created or
destroyed. A message is a
specification of stimulus,
i.e. it specifies the roles that
the sender and the receiver
objects should conform to,
as well as the Action which
will, when executed,
dispatch a stimulus that
conforms to the message.
Notation
see Examples above
(R)
(E)
Instance
An instance is an individual unit with its own identity and value. Each instance has a
descriptor, model element. MagicDraw allows you to create instances of classifiers class,
interface, use case, actor, and subsystem - in a collaboration diagram.
Instances are shown using a rectangle by underlining the name string of an instance
element. Instance of an actor is shown as an actor stick man figure with an actors name
string below the symbol.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected instance in the Instance Specification dialog box, Object (an instance of
a class) in the Object Specification dialog box, Use Case Instance in the Use Case Instance
Specification dialog box, Subsystem Instance in the Subsystem Instance Specification dialog
box.
INSTANCES SPECIFICATION DIALOG BOXES
An instance is an individual unit with its own identity and value. Each instance has a
descriptor model element. MagicDraw allows you to create instances of classifiers class,
interface, use case, subsystem, and actor - in the collaboration and implementation
diagram.
NOTE:
5-245
In this section the Specification dialog box of Object, Instance, Use Case
Instance, and Subsystem Instance will be described.
UML DIAGRAMS
Collaboration Diagram
To open the Instance, Object, Use Case Instance, or Subsystem Specification dialog
box
Choose Specification from the appropriated instance shortcut menu or double-click the
instance shape.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
Assigned Classifiers
A template is the
descriptor for a instance
with one or more
unbound formal
parameters.
Name
Type
Owner
Edit
Assign
Unassign
Type
Attribute
Instance
Attribute Links
A named slot in an
instance, which holds
the value (the instance
that is the value of the
AttributeLink) of an
attribute (the attribute
from which the
AttributeLink originates)
5-246
UML DIAGRAMS
Collaboration Diagram
menu.
3 Choose the classifier you wish to assign to an instance.
menu.
3 The Instance Specification dialog box appears. Click the Assigned Classifiers
tab.
To assign a new classifier, click the Assign button. The Select Model
Element dialog box appears. Select a classifier you wish to assign to
an instance.
To create a multiobject
1 Create a classifier role and set a multiplicity with an unbounded upper limit *.
2 Assign that classifier role to an instance.
5-247
UML DIAGRAMS
Collaboration Diagram
Edit dialog box appears. Select attributes to be visible on the instance shape.
The Suppress Attributes and Edit Compartment commands are available only
when the assigned classifier contains at least one attribute.
To reduce a diagrams complexity, instances of class (objects) that are made of sub-objects
can be represented as a composite object.
remains pressed).
Click the Sticky button on the diagram toolbar or press shortcut keys: Z,
SHIFT+CTRL+Z.
Click on the desired place in the Diagram pane. The new object is placed on
the diagram.
Click on the created object on the Diagram pane. The new object is placed on
the composite object.
Repeat this until you draw the desired number of objects.
Click the Sticky button on the diagram toolbar or press shortcut keys Z,
SHIFT+CTRL+Z.
Drag already created objects to your target object.
Link
A link represents a connection between two or more instances of class, interface, actor, and
use case. A link is an instance of an association. Through this connection, instances send
and receive messages and data.
A link end is an instance of association end.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected link in the Link Specification dialog box.
5-248
UML DIAGRAMS
Collaboration Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Link End A
Set general
Name
information about
the link
relationship
Element A
Function
The name of the link end A. Click the button to
open the Link End Specification dialog box.
The name of the model element
Link End B
Stimulus
Contains the list
of stimulus which
the current link
participates.
5-249
Name
Element B
Name
Action Type
Begins
Ends
UML DIAGRAMS
Collaboration Diagram
Tab name
Box name
Function
Edit
Remove
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Set general
information about
the link end
Name
Instance
5-250
UML DIAGRAMS
Collaboration Diagram
Classifier role
A classifier role is a specific role played by a participant in a collaboration. It specifies a
restricted view of a classifier, defined by what is required in the collaboration. The role
describes the type of Object that may play the role, such as required Operations and
Attributes, and describes its relationships to other roles. The relationships to other roles are
defined by Association Roles.
A Classifier Role is shown using a rectangle symbol.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected classifier role in the Classifier Role Specification dialog box.
Classifier Role Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Base Classifier
General
Set general
information about
the classifier role
Multiplicity
5-251
Function
Shows the base classifier of the classifier role. You
may click an arrow button and choose a classifier
role.
Choose or set your own multiplicity value.
UML DIAGRAMS
Collaboration Diagram
shortcut menu.
2 The Classifier Role Specification dialog box appears.
To assign a new base classifier, click the Base Classifier drop-down
button. The list with classifiers appears. Select a classifier you wish to
assign to a classifier role.
To edit already created classifier, click the Edit Base button. The
corresponding to a classifier Specification dialog box appears.
NOTE
shortcut menu.
2 The Classifier Role Specification dialog box appears.
3 Select the multiplicity indicator from the Multiplicity drop-down list box or type
your own indicator.
If you create a classifier role and set a multiplicity with an unbounded limit * the
classifier role is drawn as a multiple object.
Association role
Relationships between classifier roles are defined by association roles. An association role is
shown with the usual association line. The name string of the association role follows the
same syntax as for the classifier role. If the name is omitted, a line connected to classifier
role symbols denotes an association role.
For more general information about working with symbols see, Chapter 4, "Diagrams
Basics."
Define the selected association role in the Association Role Specification dialog box.
5-252
UML DIAGRAMS
Collaboration Diagram
role shortcut menu. The Association Role Specification dialog box appears.
2 In the Association End Role A or Association End Role B group box, click the
Name ... button. The Association End Role Specification dialog box appears.
Specify the association end role and click OK.
Right-click the association end role name. Specify some options in the shortsut
menu, or choose the Specification command to open the Association End Role
Specification dialog box.
Association Role Specification dialog box
5-253
UML DIAGRAMS
Collaboration Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Association End Role A
Set general
Name
The name of the association end role A. Click the
information about
button, to open the Association End Role
the association
Specification dialog box.
role
Multiplicity
Element A
Messages
Contains the list
of messages of
the current
association role.
NOTE In the
Message tab, you
are not allowed to
add messages.
Add messages
directly in the
diagram.
Name
Multiplicity
Element B
Documentation
Name
Type
Begins
Ends
Edit
Remove
Stimulus / Message
In a collaboration diagram, a Stimulus is a communication between two Instances that
conveys information with the expectation that action will ensue. A Stimulus will cause an
Operation to be invoked, raise a Signal, or cause an Instance to be created or destroyed.
A Message is a specification of a Stimulus, i.e. it specifies the roles to which the sender and
the receiver Instances should conform, as well as the Action which will, when executed,
dispatch a Stimulus that conforms to the Message.
5-254
UML DIAGRAMS
Collaboration Diagram
There are several different action types of Messages and Stimulus. Messages and Stimulus
are shown as labeled arrows placed near an Association Role or a Link, respectively. They
are shown this way to suggest that the Link is used for transportation of the Stimulus to the
target Instance. The arrow points along the line in the direction of the receiving Instance.
Name
Function
Asynchronous
message /
stimulus
Synchronous
message /
stimulus
Notation
5-255
Open the Association Role Specification dialog box. Open the Messages tab
and click the Edit button.
UML DIAGRAMS
Collaboration Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Set general
information about
the message
Action Type
Sender
Receiver
Return Value
Number
Action
Edit
Predecessors
The set of Messages
whose completion
enables the
execution of the
current Message. All
of them must be
completed before
execution begins.
5-256
UML DIAGRAMS
Collaboration Diagram
Open the Link Specification dialog box. Open the Stimulus tab and click the Edit
button.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General tab
Action Type
Set general
information about
the stimulus
5-257
Function
The type of the action: uninterpreted, call, send,
create, destroy. Click the button, to open the
Action Specification dialog box.
Sender
Receiver
Link
UML DIAGRAMS
Collaboration Diagram
NOTE
appears.
3 Choose the action type from the Type drop-down box. See Section Actions
on page 5-260.
Numbering command.
5-258
UML DIAGRAMS
Collaboration Diagram
Box name
Function
Number
Type
Name
Edit
The Type Number dialog box appears. Type the number of the
stimulus/message.
Increase
Decrease
OK
Cancel
Help
5-259
UML DIAGRAMS
Collaboration Diagram
All of the sequence numbers with the same prefix form a sequence. The numerical
predecessor is the one in which the final term is one less. That is, number 3.1.4.5 is the
predecessor of 3.1.4.6, where the number 3 is an activator.
Choose Symbol(s) Properties command from the message shortcut menu and
select the Show Predecessors check box.
and predecessors.
If you change the activator number to one of the predecessor message, this
number also changes for other predecessors.
Define the selected stimulus in the Stimulus Specification dialog box. For a detailed
description of this dialog box, see Section Stimulus Specification dialog box on
page 5-257.
Define the selected message in the Message Specification dialog box. For a detailed
description of this dialog box, see Section Message Specification dialog box on
page 5-256.
Actions
An action is a specification of an executable statement that forms an abstraction of a
computational procedure, resulting in a change in the state of the model. It can be realized
by sending a message to an object, or by modifying a link or a value of an attribute.
Specify assigned actions in the Action Specification dialog box.
In the Message Specification and Stimulus Specification dialog boxes, click the
Action Type button.
In the Transition Specification dialog box, click the Edit button in Effect group
box.
5-260
UML DIAGRAMS
Collaboration Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
NOTE:
Tab name
General
Script
Set general
information about
Target
the action
Function
Type an action expression that describes the effects of
the action.
Type an ObjectSetExpression, which a target of an
action and resolves into zero or more instances when
the action is executed.
Type
5-261
UML DIAGRAMS
Collaboration Diagram
Tab name
Arguments
An argument is an
expression
describing how to
determine the
actual values
passed in a
dispatched
request.
Box
Function
Operation
(only for call
action)
Instantiation
(Only for create
action)
Recurrence /
Condition
Iteration
Asynchronous
Expression
Edit
Add
Remove
5-262
UML DIAGRAMS
Collaboration Diagram
ACTION
TYPES
Action Type
Description
Characteristics
Representation
Collaboration Sequence
diagram
diagram
Create
An action in which
an instance is
created based on
the definitions of the
specified set of
classifiers.
Instantiation
Stimulus and
(classifier) - the
message
Classifier of which
an Instance will be (new)
created when the
Create Action is
performed.
Call
An action in which a
stimulus is created
that causes an
operation to be
invoked on the
receiver.
Operation - the
operation, which
will be invoked
when the Action is
executed.
Send
An action in which a
stimulus is created
that causes a signal
event for the
receiver(s).
Stimulus and
message
Destroy
An action in which
an instance causes
another instance to
cease to exist.
Stimulus and
message
Stimulus and
message
Return
An action that
returns a value to a
caller.
Message
Terminate
An action in which
an instance causes
itself to cease to
exist.
Message
Assignment
An action that
assigns an instance
to an attribute link,
or a link.
Message
Message is
connected
directly to
an object
(not
lifeline).
Stimulus and
message
A large X
mark is
displayed
on the
objects
lifeline in
the
messages
destination.
Set the following features for an action in the Action Specification dialog box.
5-263
UML DIAGRAMS
Collaboration Diagram
Attribute
Description
How to
Recurrence
/Condition
Script
An action expression
Type an expression in the Script text
describing the effects of the box.
action.
Argument
An argument is an
expression describing how
to determine the actual
values passed in a
dispatched request. It is
aggregated within an
action.
Active objects
An active object is an object that has its own state machine and a thread of control. An
active object executes concurrently with other active objects. They are used to model realtime systems. An active object is an instance of an active class that is implemented as a
thread or a process.
These objects may have a synchronization mechanism to prevent them from concurrently
using the same resource. The problem is solved by sending synchronous messages. Active
objects communicate using synchronous messages or messages mailbox and queues. This
technique allows a message to be sent and received asynchronously (a sender object does
not wait for an answer from a recipient object).
An active object is shown as a rectangle with a heavy border and an underlined object
name inside. Frequently, an active object is shown as a composite with embedded parts to
explain its internal structure. These internal objects might be passive as well as active. You
may also use a keyword {active} to indicate an active object.
5-264
UML DIAGRAMS
Sequence Diagram
SEQUENCE DIAGRAM
A sequence diagram shows interaction information with an emphasis on the time sequence.
The diagram has two dimensions: the vertical axis represents time, while the horizontal axis
represents participating objects. The time axis could be an actual reference point (by
placing the time moments labels as text boxes). Horizontal ordering of the objects is not
significant to the operation, and you may rearrange them as necessary. The 3D-interaction
model (See Interaction representation in 3-Dimensional view on page 243.)
5-265
UML DIAGRAMS
Sequence Diagram
Button (hot
key)
Notation
(O)
Activation Bar
Focus of control. Shows the
period during which an
object is performing an
action either directly or
through a subordinated
procedure.
Interaction Use
Reference to collaboration
diagram, sequence diagram
and time diagram can be
created.
Combined Fragment
A fragment of sequence
diagram can be separated.
(SHIFT+T)
(F)
5-266
UML DIAGRAMS
Sequence Diagram
Model elements
Message Default:
synchronous uninterpreted
A communication between
objects that conveys
information with the
expectation that action will
ensue. The receipt of a
message is one type of
event.
Button (hot
key)
Notation
(M)
Message to Self
(S)
Diagonal Message
Requires some time to
arrive, during which another
action occurs.
(D)
Concurrent Lifeline
A conditional branch in the
message flow.
(L)
Recursive message
A connected set of messages
can be enclosed and
marked as iteration.
(R)
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
5-267
UML DIAGRAMS
Sequence Diagram
Define the selected association role in the Classifier Role Specification dialog box. For a
detailed description of this dialog box, see Section Classifier Role Specification dialog
box on page 5-251.
For more information on working with classifier roles, see Section Classifier role on
page 5-251.
Interaction Use
Interactions are units of behavior of an enclosing Classifier. Interactions focus on the
passing of information with Messages between the ConnectableElements of the Classifier.
Reference to collaboration diagram, sequence diagram and time diagram can be created.
5-268
UML DIAGRAMS
Sequence Diagram
Tab name
Box
Function
Refers To
Combobox
Reference to
specified diagram.
Attribute
Text box
Return value
Text box
Arguments
List
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
C o m b i n e d Fr a g m e n t
5-269
UML DIAGRAMS
Sequence Diagram
Fragment is an abstract notion of the most general interaction unit. The Fragment is a piece
of an interaction. Each interaction fragment is conceptually like an interaction by itself.
Using Combined Fragment, a fragment of sequence diagram can be separated.
Combined Fragment Specification dialog box
Tab name
Box
Function
Guard
Text box
Operator
Combobox
Operands
List
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
5-270
UML DIAGRAMS
Sequence Diagram
Lifelines
A lifeline represents the existence of the object at a particular time. It stretches from the top
to the bottom of the diagram. In a sequence diagram, an object lifeline denotes an Object
playing a specific role.
To destroy a sequence object - a large X at the end of its lifeline marks its destruction
Choose Destroy Mark from the lifeline or classifier role shortcut menu.
When an object receives a message, an activity starts in that object. An activation (focus of
control) shows the period during which an object is performing an action either directly or
through a subordinate procedure. The activation bar is used to denote that activity.
After resizing, the lines on an activation bar are thickened and the size of an
activation bar may not change automatically.
The lifeline may split into two or more concurrent lifelines to show conditionality. Each
corresponds to a conditional branch in the message flow. Lifelines may merge together at
some subsequent point.
5-271
UML DIAGRAMS
Sequence Diagram
Function
Synchronous
Typically implemented
as an operation call.
The operation that is
called should be
completed before the
caller resumes
execution. The return
can be shown as a
simple message or it
can be omitted.
Asynchronous
Asynchronous means
that the source is not
waiting for the
acceptance.
Notation
Balking
message
5-272
UML DIAGRAMS
Sequence Diagram
Message type
Function
Notation
Time-out
Send
Create
Create action is an
action in which an
instance is created
based on the definitions
of the specified set of
classifiers.
Return
Return action is an
action that returns a
value to a caller.
5-273
UML DIAGRAMS
State Diagram
Message type
Function
Destroy
Destroy action is an
action in which an
instance causes another
instance to cease to
exist.
Terminate
Terminate action is an
action in which an
instance causes itself to
cease to exist.
Uninterpreted
A simple message
shows the control flow
from a sender to a
receiver without
presenting any details
about the
communication process.
Notation
STATE DIAGRAM
The behavior of objects of a class can be described in terms of states and events, using a
state machine connected to the class under construction.
A state machine is a specification of the sequence of states through which an object or an
interaction goes in response to events during its life, together with responsive actions. The
state machine may represent the sequence of states of a particular collaboration (i.e.
collection of objects) or even the whole system (which is also considered a collaboration).
The abstraction of all possible states defined in a state machine is similar to the way class
diagrams are abstracted: all possible object types (classes) of a particular system are
described.
Objects that do not present a very pronounced reactive behavior may always be considered
to stay in the same state. In such a case, their classes do not possess a state machine.
State diagrams (also called Statechart diagrams) represent the behavior of entities capable
of dynamic behavior by specifying its response to the receipt of event instances. Typically,
state diagrams describe the behavior of classes, but statecharts may also describe the
behavior of other model entities such as use-cases, actors, subsystems, operations, or
methods.
A state diagram is a graph that represents a state machine. States and various other types
of vertices (pseudostates) in the state machine graph are rendered by appropriate state and
pseudostate symbols, while transitions are generally rendered by directed arcs that interconnect them. States may also contain subdiagrams by physical containment or tiling. Note
that every state machine has a top state, which contains all the other elements of the entire
state machine. The graphical rendering of this top state is optional.
2005 No Magic, Inc
5-274
UML DIAGRAMS
State Diagram
The states are represented by state symbols, while the transitions are represented by arrows
connecting the state symbols.
A state diagram concerns internal object changes (as opposed to the external object
interaction in collaboration). Do not attempt to draw them for all classes in the system,
because they are used only for modeling a complex behavior. A state diagram shows all the
possible states that objects or collaborations may have, and what events cause the state to
change. An event can be another object that sends a message to it: for example, that a
specified time has elapsed or that some condition has been fulfilled. A change of a state is
called a transition. A transition may also have an action connected to it that specifies what
should be done in connection with the state transition.
Model elements
Button
(hot key)
State
A condition or situation
during the life of an object
or an interaction during
which it satisfies some
condition, performs some
action, or waits for some
event.
(S)
Concurrent State
A state containing other
state vertices (states,
pseudostates, etc.). It is
useful when a given object
contains sets of
independent behaviors.
(C)
Submachine
Represents the invocation
of a state machine defined
elsewhere.
Action State
A state with an internal
action and at least one
outgoing transition
involving the implicit event
of completing the internal
action (there can be
several such transitions if
they have guard
conditions).
5-275
Notation
(M)
(A)
UML DIAGRAMS
State Diagram
Model elements
Call State
A call state is an action
state that has exactly one
call action as its entry
action. It is useful in object
flow modeling to reduce
notational ambiguity over
which action is taking
input or providing output.
Initial State
Denotes an initial state
when an object is created.
Final State
Denotes an objects
destruction or the end of
collaboration.
Synch State
A special state that
enables synchronization of
control between two
concurrent regions in a
state machine.
History State
Serves for internal state
memorizing. A history
state indicates that the
enclosing composite state
remembers its previously
active substate after it
exits.
Junction Point
A junction point is used to
merge and split
transitions.
Button
(hot key)
Notation
(K)
(I)
(F)
(Y)
(R)
(J)
5-276
UML DIAGRAMS
State Diagram
Model elements
Dynamic Choice Point
Dynamic choice points are
used for splitting transition
paths. In the dynamic
choice point, a decision
on which branch to take is
only made after the
transition from State1 is
taken and the choice point
is reached.
Stub State
Represents already created
state.
Vertical Synchronization
Bar
Helps to control parallel
actions.
Horizontal Synchronization
Bar
Helps to control parallel
actions.
Transition
A relationship between
two states indicating that
an object in the first state
will enter the second state
and perform certain
specified actions when a
specified event occurs if
specified conditions are
satisfied.
Transition to Self
When an object returns to
the same state after the
specified event occurs.
5-277
Button
(hot key)
Notation
(D)
(U)
(V)
(B)
(T)
(E)
UML DIAGRAMS
State Diagram
State
A state is a condition during the lifetime of an object or an interaction during which the
object meets certain conditions, performs an action, or waits for an event. States are
defined by the concepts of duration and stability. An object may not be in an unknown or
undefined state. A state may have three compartments to provide more information about
that state:
The first compartment - name compartment - contains state name, for example:
running, going up.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected state in the Composite State Specification dialog box.
Composite State Specification dialog boxT
5-278
UML DIAGRAMS
State Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Detail
Contains the state
actions, events
and buttons for
editing list.
Function
Entry
Edit
Remove
Exit
Edit
Remove
Do Activity
Edit
Remove
Edit
Add
Remove
Internal Transitions
A set of transitions
that, if triggered,
occur without
exiting or entering
the state. This
means that the
entry or exit
condition of the
State will not be
invoked.
Name
Edit
Add
Remove
Attributes
The list of state
attributes and
buttons for editing
them.
NOTE Only the
name of the
attribute can be
edited.
Name
Edit
Add
Remove
Inner States
Name
The list of inner
states and buttons
Edit
for editing them.
5-279
UML DIAGRAMS
State Diagram
Tab name
Box name
Function
Add
Remove
To control a list of actions and attributes that are visible in a diagram for the class view
From the state shortcut menu, choose Edit Compartment. The Compartment Edit
dialog box appears. In the Actions or Attributes tabs, move elements you want to
hide or see on a diagram between All and Selected lists.
Open the Composite State Specification dialog box, Attributes tab and click the
Add button. Specify attribute name in the Type Name dialog box.
Any state may have its own internal states, also known as substates. Substates describe what
occurs inside a particular state of an object. A composite state is either a network of
disjointed substates or a set of concurrent substates.
The start and end states may also be internal states. All internal states of a composite state
can be deemed as a separate state diagram.
5-280
UML DIAGRAMS
State Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
Detail
Actions group box
Contains the state
Entry
The type of the entry action.
actions, events and
buttons for editing list. Edit
The Action Specification dialog box appears.
Remove
Exit
Edit
Remove
Do Activity
Edit
Remove
5-281
Name
Edit
Add
Remove
UML DIAGRAMS
State Diagram
Tab name
Box name
Function
Internal Transitions
A set of transitions
that, if triggered,
occur without exiting
or entering the state.
This means that the
entry or exit condition
of the State will not be
invoked.
Name
Edit
Add
Remove
Concurrent state
A concurrent state (also known as a concurrent composite state) is divided into two or more
substates (called regions). It is a state that contains other state vertices (states, pseudostates,
etc.). Naturally, any substate of a concurrent state may also be a composite state of either
type. Any state enclosed within a composite state is called a substate of that concurrent
state.
An expansion of a state shows its internal state machine structure. A concurrent state is
shown as a simple state with the regions that are separated by dashed lines. You may
enclose all kinds of states in a concurrent states regions.
For more general information about working with symbols see Chapter 4, "Diagrams
Basics."
Define the selected concurrent state in the Composite State Specification dialog box. For a
detailed description of this dialog box, see Section Composite State Specification dialog
boxT on page 5-278.
For more information on working with states, see Section State on page 5-278.
To remove any region from the concurrent state (at least two regions have to be left)
Choose Remove Region from the concurrent state shortcut menu and choose a
region you want to remove.
Submachine
A submachine state represents the invocation of a state machine defined elsewhere.
5-282
UML DIAGRAMS
State Diagram
The submachine state is depicted as a normal state with the appropriate include
declaration within its internal transitions compartment. As an option, the submachine state
may contain one or more stub states, which represent already created states.
For more general information about working with symbols see, Chapter 4, "Diagrams
Basics."
Define the selected submachine in the Submachine State Specification dialog box.
Submachine State Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Include
Detail
Contains the
submachine
actions, events
and buttons for
editing list.
Edit
Remove
Exit
Edit
Remove
Do Activity
Edit
Remove
5-283
UML DIAGRAMS
State Diagram
Tab name
Box name
Function
Edit
Add
Remove
Internal Transitions
A set of transitions
that, if triggered,
occur without
exiting or entering
the submachine.
This means that
the entry or exit
condition of the
Submachine will
not be invoked.
Name
Edit
Add
Remove
Attributes
The list of
submachine
attributes and
buttons for editing
them.
NOTE Only the
name of the
attribute can be
edited.
Name
Edit
Add
Remove
Inner States
Name
Only the stub
Edit
state can be
added to the
submachine state.
Add
Remove
For more information on submachine states see, Section State on page 5-278
Define a stub state in the Stub State Specification dialog box. .
5-284
UML DIAGRAMS
State Diagram
Synch state
A synch state is a special state that enables synchronization of control between two
concurrent regions in a state machine.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected synch state in the Synch State Specification dialog box.
State Vertex Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
NOTE:
The name of the dialog box changes according state vertex type.
Tab name
Box name
Function
General
Set general
information about
the state vertex
NOTE Dynamic
choice point,
junction point,
stub state, history
state, synch state,
initial state are
specified in the
State Vertex
Specification
dialog box.
Pseudo Kind
Dynamic choice point: choice Junction point:
NOTE Available junction History state: set history state as deep history
for dynamic
or shallow history state. Initial state: initial.
choice point,
junction point,
history state,
initial state.
Reference
The Select Model Element dialog box appears. Select
NOTE Available the model element you wish the stub state will
for stub state.
represent. The name of the assigned model element
appears in the text box.
Bound
Unspecified: The * is shown in the synch state.
NOTE Available Specified: Type the numeric value from 0 to
for synch state. 2147483647 in the text box. By default the number
is 0.
5-285
UML DIAGRAMS
State Diagram
Ps e u d o S t a t e s
A pseudostate is an abstraction that encompasses different types of transient vertices in the
state machine graph. They are typically used, to connect multiple transitions into more
complex state transitions paths.
Specify pseudostates in the Pseudo State Specification dialog box.
NOTE
Any transition from the pseudostate does not contain a trigger event.
INITIAL STATE
Every object is in some particular state as soon as it is created, so it is useful to explicitly
show that state. A solid filled circle represents the initial state of an object. There can only
be one initial state for an object. An initial state denotes the starting place for a transition,
the target of which is a composite state.
FINAL STATE
To represent the objects destruction, use the final state symbol (a circle surrounding a
smaller solid circle). The final state is optional in the diagram because there is a system that
runs without interruption after the start of the activities. Also, there can be several final states
in the same state diagram, denoting that the objects life may finish depending to several
conditions.
HISTORY STATE
A history state serves for internal state memorizing, indicating that the enclosing composite
state remembers its previously active substate after it exits.
A deep history state is used to remember a state that has been nested at some depth within
a composite state.
A shallow history state is used to remember a state that is at the same nesting depth as the
history state itself.
History state can be a deep history state (with a letter H) or of shallow history state (with a
letter H). By default deep history shape is drawn.
5-286
UML DIAGRAMS
State Diagram
5-287
UML DIAGRAMS
State Diagram
ACTION
LABELS
Action name
Description
Entry
Exit
Do activity
Events
An event is a specification of a type of observable occurrence. The occurrence that
generates an event instance is assumed to take place at an instant in time with no duration.
Define the selected event in the Event Specification dialog box.
In the Transition Specification dialog box, click the Edit button in Trigger group
box.Event Specification dialog box
5-288
UML DIAGRAMS
State Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
NOTE:
Tab name
Box
General
Type
Set general
information about
the event
Expression
Function
Define the type of event: signal, call, time, or change.
NOTE The
Expression text
box is available
for time and
change events
Operation
NOTE The
Operation text
box is available
for a call event.
Parameters
A parameter is an
unbound variable
that can be
changed, passed,
or returned.
Name
Type
Default value
Direction kind
Up
Down
Edit
Add
Remove
5-289
In the Transition Specification dialog box, click the Edit button in Trigger group
box.
UML DIAGRAMS
State Diagram
EVENT
TYPES
Name
Description
Signal
Call
Time
Change
Internal transitions
In all other cases, the action label identifies the event that triggers the corresponding action
expression. These events are called internal transitions and are semantically equivalent to
self transitions except that the state is not exited or re-entered. This means that the
corresponding exit and entry actions are not performed.
For more information on defining transitions, see Section Transition on page 5-291.
Specify transition in the Transition Specification dialog box. For a detailed description of this
dialog box, see Section Transition Specification dialog box on page 5-291.
The general format for the list item of an internal transition is:
event-name ( comma-separated-parameter-list ) [ guard-condition] / action-expression
5-290
UML DIAGRAMS
State Diagram
Tr a n s i t i o n
Drawing an arrow from one state to other denotes that objects change from one state to
another when a specified event occurs (trigger event) and specified guard conditions are
satisfied. A simple transition has a single source state and a single target state. A complex
transition has more that one target and source states. A transition indicates the way an
object in a state responds to the occurrence of an event.
The event may have parameters. These are accessible by the actions specified on the
transition as well as in the corresponding exit and entry actions associated with the source
and target states, respectively. Events are processed one at a time.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected transition in the Transition Specification dialog box.
Transition Specification dialog box
The Transition Specification dialog box defines transition or trigger link..
5-291
UML DIAGRAMS
State Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Target
Set general
information about
the transition
Function
The name of the model element (state, submachine,
action state, concurrent state, subactivity, other),
which is the target of the transition.
Source
Edit
Remove
Edit
Remove
Edit
Remove
The difference between a transition in state diagrams from a transition in activity diagrams
lies in the event. A transition is often triggered by some specified event in state diagrams,
but a transition in activity diagrams has no defined event. An exception is made for
transitions that go from the start point to the first activity. They may have an attached event
thats defined when the first activity starts.
5-292
UML DIAGRAMS
State Diagram
NOTE
5-293
UML DIAGRAMS
Activity Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Name
Set general
information about
the guard
Function
Type the guard name. If you enter the name of the
already existing guard, an error message box
appears.
NOTE The name of the guard is not visible on the
diagram.
Expression
Check OCL
Syntax
ACTIVITY DIAGRAM
An activity graph is a variation of a state machine. In a state machine, the states represent
the performance of actions or subactivities, while the transitions are triggered by the
completion of the actions or subactivities. It represents a state machine of a procedure
itself. The entire activity diagram is attached (through the model) to a class, such as a use
5-294
UML DIAGRAMS
Activity Diagram
5-295
UML DIAGRAMS
Activity Diagram
Button
(hot key)
Notation
(A)
(S)
(K)
(C)
(M)
5-296
UML DIAGRAMS
Activity Diagram
Element
Subactivity State
Represents an activity
graph. Entering a
subactivity state
represents, entering the
activity graph, which is
nested in the subactivity
state.
Interaction Use
Reference to
Collaboration, Sequence
and Time diagrams can
be created.
Button
(hot key)
(Q)
(SHIFT
+T)
Initial State
Denotes an initial state
when an object is
created.
(I)
Final State
Denotes an objects
destruction or the end of
collaboration.
(F)
Flow Final
Final node that
terminates a flow.
Destroys all tokens that
arrive at it. It has no
effect on other flows in
the activity.
Transition
A relationship between
two states indicating that
an object in the first state
will enter the second state
and perform certain
specified actions when a
specified event occurs,
once specified conditions
are satisfied.
Notation
(SHIFT
+F)
(T)
Exception Handler
An element that specifies
a body to execute in case
the specified exception
occurs during the
execution of the
protected node.
5-297
UML DIAGRAMS
Activity Diagram
Element
Button
(hot key)
Horizontal
Synchronization Bar
Helps to control parallel
actions.
(B)
Vertical Synchronization
Bar
Helps to control parallel
actions.
(V)
Input Pin
A pin that holds input
values to be consumed
by an action.
Output Pin
A pin that holds output
values produced by an
action.
Decision Point
Is used to model
conditional branching.
Notation
(SHIFT
+I)
(SHIFT
+O)
(D)
Signal Receipt
(R)
Signal Sending
(G)
5-298
UML DIAGRAMS
Activity Diagram
Element
Swimlanes
Swimlanes are used to
organize responsibility for
actions and subactivities
according to class,
dividing an activity
diagram.
Object Flow State
Objects that are input to
or output from an action.
Central Buffer
It is an object node for
managing flows from
multiple sources and
destinations.
Data Store
It is a central buffer node
for non-transient
information.
Button
(hot key)
Notation
(P)
(O)
(SHIFT
+B)
(SHIFT
+D)
Action state
Action state is sometimes called an activity. An action state is a shorthand for a state with an
entry action, plus at least one outgoing transition involving the implicit event of completing
the entry action. There can be several such transitions if they have guard conditions.
An action state is performed to produce a result, to describe an implementation of an
operation. The transition triggers as soon as all activities in the action state are performed.
An action state is shown as a shape with a straight top and bottom and with convex arcs on
the two sides. The action-expression is placed in the symbol.
For more general information about working with symbols see, Chapter 4, "Diagrams
Basics."
Define the selected action state in the Action State Specification dialog box.
5-299
UML DIAGRAMS
Activity Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
Multiplicity
Set general
information about
an action state
Arguments
Dynamic
Detail
Actions: Entry
Define an entry
Edit
action and events.
Function
Remove
Deferrable
Events: Name
Edit
5-300
UML DIAGRAMS
Activity Diagram
Tab name
Box
Function
Add
Remove
NOTE
NOTE
5-301
For more information defining actions, see Section Actions on page 5-260 and
Section Actions in State and Activity diagrams on page 5-287.
UML DIAGRAMS
Activity Diagram
Call State
A call state is an action state that has exactly one call action as its entry action. It is useful in
object flow modeling to reduce notational ambiguity over which action is taking input or
providing output.
choose Assign.
4 In the appeared Assign State/Activity Diagram dialog box, click New and select
State Diagram or Activity.
5 Type State/Activity diagram name and close all dialogs by clicking OK.
6 In the created State/Activity diagram, draw a call state and open the Call State
Specification dialog box, the Detail tab.
7 Click the Edit button in the Actions group box. The Call Action Specification
dialog box appears.
8 From the Operation drop-down list box, select the desired operation.
9 Click OK in all previous dialog boxes.
Operation that a call state invokes will appear on the call state shape.
Subactivity state
A subactivity state is represented in the same way as an action state, with the addition of an
icon in the lower right corner depicting a nested activity diagram. On the subactivity, the
name of the entered activity graph is shown. A subactivity state represents an activity graph.
Entering a subactivity state represents entering the activity graph, which is nested in the
subactivity state. The subactivity state is not exited until the final state of the nested graph is
reached, or when trigger events occur on transitions coming out of the subactivity state.
Since states in activity graphs do not normally have trigger events, subactivity states are
normally exited when their nested graph is finished. A single activity graph can be invoked
by many subactivity states.
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
5-302
UML DIAGRAMS
Activity Diagram
Define the selected subactivity state in the Subactivity State Specification dialog box.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Include
Set general
information about
the subactivity
state
5-303
Function
Select the already created state machine or activity
diagram to include in the subactivity state.
UML DIAGRAMS
Activity Diagram
Tab name
Box name
Function
Multiplicity
NOTE Is
available only
when a
subactivity state
is set as
dynamic.
Arguments
NOTE Is
available only
when a
subactivity state
is set as
dynamic.
Dynamic
Detail
Contains the
subactivity state
actions, events
and buttons for
editing list.
Edit
Remove
Exit
Edit
Remove
Do Activity
Edit
Remove
Edit
Add
Remove
F l o w Fi n a l
It is a final node that terminates a flow. Destroys all tokens that arrive at it. It has no effect
on other flows in the activity.
5-304
UML DIAGRAMS
Activity Diagram
For more information defining pseudo states, see Section PseudoStates on page 5-286.
D e c i s i o n Po i n t
Decisions are made using guard conditions. They help protect transitions that depend on a
guarding condition. The symbol used for the decision is a large diamond, which may have
one or more incoming transitions and two or more outgoing transitions.
A decision point in an activity diagram is used much like a dynamic choice or junction point
in state diagrams. Decision points allows to separate and merge transition paths back
together.
5-305
UML DIAGRAMS
Activity Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Type
Set general
information about
the object flow
state
Detail
Contains the
object flow state
attributes list and
buttons for editing
attributes list.
Function
The list of classifiers. Select a classifier you wish to
assign to an object flow state shape. Click the
button to open the corresponding classifier
specification dialog box.
Assign State
NOTE The
Assign State
button is
activated when
the object flow
states type is a
classifier.
Synch State
Edit
Remove
Exit
5-306
UML DIAGRAMS
Activity Diagram
Tab name
Box name
Function
Edit
Remove
Do Activity
Edit
Remove
Edit
Add
Remove
drop-down list box. The Assign State button is activated and you may create a
classifier in state.
3 Click the Assign State button.
Classifier in State Specification dialog box
5-307
UML DIAGRAMS
Activity Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
General
States
Set general
Name
information about
the classifier in
Type
state
Function
Shows the name of the assigned state.
The type of the assigned state.
Owner
Assign
Unassign
shortcut menu. The Object Flow State Specification dialog box appears.
2 Choose a classifier you wish to assign to an object flow from the Type dropdown box.
NOTE
5-308
UML DIAGRAMS
Activity Diagram
NOTE
SIGNAL RECEIPT
The receipt of a signal can be shown as a concave pentagon that looks like a rectangle
with a triangular notch on one end (either end). The signature of the signal is shown inside
the symbol. An unlabeled transition arrow is drawn from the previous action state to the
pentagon and another unlabeled transition arrow is drawn from the pentagon to the next
action state. A dashed arrow can be drawn from an object symbol to the notch on the
pentagon to show the sender of the signal; this is optional.
NOTE
Swimlanes
Actions and subactivities can be organized into swimlanes in activity diagrams. Swimlanes
are used to organize responsibility for actions and subactivities according to class. They
often correspond to organizational units in a business model.
An activity diagram can be divided visually into swimlanes, each separated from
neighboring swimlanes by vertical or horizontal solid lines on both sides. Each swimlane
represents responsibility for part of the overall activity, and may eventually be implemented
by one or more objects. The relative ordering of the swimlanes has no semantic
significance, but might indicate some affinity. Each action is assigned to one swimlane.
Transitions may cross lanes. There is no significance to the routing of a transition path.
5-309
UML DIAGRAMS
Activity Diagram
Also multidimentional swimlanes can be created (from the swimlane shortcut menu, choose
the Insert Vertical Swimlane or Insert Horizontal Swimlane commands):
5-310
UML DIAGRAMS
Activity Diagram
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Diagram Name
Set general
information about
the partition
Content
Name
Type
Element type.
Edit
menu.
2 The Partition Specification dialog box appears. Type a name in the Name box.
Type the name directly on the Diagram pane.
5-311
UML DIAGRAMS
Implementation Diagrams
IMPLEMENTATION DIAGRAMS
Implementation diagrams help the developer describe the logical software structure inside a
computer or across a large distributed system. Implementation diagrams show aspects of
physical implementation, including the structure of components and the run-time
deployment system.
They come in two forms:
1 Component diagrams show the structure of components, including the
classifiers that specify them and the artifacts that implement them; and
2 Deployment diagrams show the structure of the nodes on which the
components are deployed.
These diagrams can also be applied in a broader way to business modeling where the
components represent business procedures and artifacts, and the deployment nodes
represent the organization units and resources (human and otherwise) of the business.
5-312
UML DIAGRAMS
Implementation Diagrams
located in a way that shows where the software units are residing and on which nodes they
are executed. You may also show dependencies between the components.
5-313
UML DIAGRAMS
Implementation Diagrams
Button (hot
key)
Notation
(K)
Component Instance
(A)
Port
(SHIFT+
F11)
Node
A physical object
(devices.)
(O)
Node Execution
Environment
Element is used for
indicating that node is
execution environment.
Node Device
A physical
computational resource
with processing
capability upon which
artifacts may be
deployed for execution.
5-314
UML DIAGRAMS
Implementation Diagrams
Element
Button (hot
key)
Notation
Node Instance
(T)
Node Instance
Execution Environment
Element is used for
indicating that node is
execution environment.
Package
A group of classes and
other model elements.
Interface
All functionality
implemented by a
particular component.
(P)
(F)
Class
(C)
5-315
UML DIAGRAMS
Implementation Diagrams
Element
Artifact
An artifact represents a
physical piece of
information that is used
or produced by a
software development
process. Examples of
Artifacts include
models, source files,
scripts, and binary
executable files. An
Artifact may constitute
the implementation of
a deployable
component.
Button (hot
key)
Notation
(B)
Artifact Deployment
Spec
It indicates set of
properties that define
how a component
should be deployed.
Instance
Object
A particular instance of
a classifier. It has a
unique name, state,
and classifier as the
type of identifier.
(I)
(SHIFT+O)
Instance Deployment
Spec
Association
(S)
Link
A relationship between
specification element
and implementation
element.
(L)
5-316
UML DIAGRAMS
Implementation Diagrams
Element
Button (hot
key)
Notation
Generalization
(G)
Realization
(E)
(R)
Dependency
Shows an undirectional
relationship.
(D)
Assembly connector
Can be applied from
port to component part
and vce versa, between
two ports, between two
parts.
Delegation
Can be applied
between provided and
required interfaces and
between ports and
components.
5-317
UML DIAGRAMS
Implementation Diagrams
Element
Button (hot
key)
Notation
Deployment
Connects Artifact to
Node on which it is
deployed. Deployment
relationship may have
associated deployment
specification. This
relationship between
<<deploy>>
dependency and
<<deployment
spec>>. Artifact or
Instance is mapped into
dependency without
arrow
Manifestation
Connects physical
implementation
Component to abstract
Component.
Components
A component represents all kinds of elements that pertain to piecing together software
applications. They can be simple files, such as DLLs or executables.
According to UML 2.0, now there is possibility to list component properties. The following
compartment are available for component:
Provided/required interfaces
Realizations
5-318
UML DIAGRAMS
Implementation Diagrams
Artifacts
For more general information about working with symbols, see Chapter 4, "Diagrams
Basics."
Define the selected component in the Component Specification dialog box.
Component Specification dialog box
5-319
UML DIAGRAMS
Implementation Diagrams
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Set general
information
about the
component
Visibility
Resident
Name
Elements
Model elements Type
that are
Visibility
assigned to the
component.
Deployment
Location
Contains the
nodes list,
where the
current
component
participates
Owner
Edit
Assign
Unassign
Name
Type
Owner
Edit
Implementation Name
Contains the list
Type
of artifacts that
implement
component
Inner
Components
The list of the
components
that contains
the current
component.
Owner
Edit
Name
Type
Edit
5-320
UML DIAGRAMS
Implementation Diagrams
Tab name
Box name
Function
Add
Remove
Nodes
Any computer or device that is relevant to the implemented system can be shown as a
node. A node is drawn as a three-dimensional cube with a name inside it. Devices in a
system are typically represented with a stereotype that specifies the device type. Nodes can
be represented as types and as instances.
A node is shown as a figure that looks like a 3-dimensional view of a cube.
For more general information about working with symbols see Chapter 4, "Diagrams
Basics."
Define the selected node in the Node Specification dialog box.
5-321
UML DIAGRAMS
Implementation Diagrams
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Visibility
Set general
information about
the node
Function
Deployed
Components
Assign
components to a
node
Name
Type
Owner
Edit
Assign
Unassign
5-322
UML DIAGRAMS
UML Extension Mechanisms
NOTE
To remove the assigned component from the node, click the Unassign
button.
Stereotype
A stereotype is an extension mechanism that defines a new and more specialized element of
the model based on an existing element. Stereotype can be based on all types of elements
including classes, packages, components, and notes, as well as such relationships as
associations, generalizations, and dependencies. A stereotyped element derives all base
element properties and may have additional constraints.
Stereotypes are treated as separate model elements. For more general information about
working with symbols see Chapter 4, "Diagrams Basics."
Define the selected stereotype in the Stereotype Specification dialog box.
1 From the Tools menu, choose Stereotypes and then choose Edit Stereotypes.
-orIn the element Specification dialog box, Stereotypes tab, click the Edit button.
2 The Edit Stereotypes dialog box appears.
3 Choose the desired model element and click the Add button. The Select
Extension Element Storage dialog box appears. Select a package and click OK.
-orSelect the desired stereotype and click Edit.
5-323
UML DIAGRAMS
UML Extension Mechanisms
STEREOTYPE SPECIFICATION
DIALOG BOX
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Icon
Set general
information about
the stereotype.
Remove
Base Classes
All
The list of model >
elements to which
the stereotype can
be applied.
<
The file name of the icon image file that represents the current
stereotype.
To choose the icon for the selected stereotype. Click the
button. The Open dialog box appears.
Remove the assigned icon from the current stereotype.
The list of all model elements.
Move the selected model element from the All to the Selected
list.
Move the selected model element from the Selected to the All
list.
>>
Move all model elements from the All to the Selected list.
<<
Move all model elements from the Selected to the All list.
Selected
The list of the selected model elements for which the current
stereotype can be assigned.
Function
Owner
Edit
5-324
UML DIAGRAMS
UML Extension Mechanisms
Tab name
Box name
Function
Defined Tags
Name
Type
Edit
Add
Remove
1 From the base class shortcut menu in the Browser, Model Extensions Tree,
NOTE
To export/import stereotypes
Since MagicDraw version 7.0, stereotypes must be exported using modules functionality.
The detailed description about model partitioning in MagicDraw, see Section Modules
Functionality. Reusing project part - Partitioning on page 3-63.
open the Stereotypes tab. Choose a model element for which you would like to
create a stereotype with an icon.
-orIn the element Specification dialog box, Stereotypes tab, click the Edit button,
the Edit Stereotypes dialog box appears.
2 Click the Add button. The Stereotypes Specification dialog box appears.
3 Click the Icon ... button and from the Open dialog box, select an image you
want to place for a stereotype. Click the Open button.
4 Type the name of a stereotype and click OK in all opened dialog boxes.
5-325
UML DIAGRAMS
UML Extension Mechanisms
In the table below, there are listed all predefined stereotypes for model elements.
NOTE
PROFILES
The table contains also stereotypes that are imported from the <MagicDraw
installation directory>/Stereotypes folder.
DIALOG BOX,
STEREOTYPES
TAB
From the Tools menu, choose Profiles. The Profiles dialog box appears. Select the
desired profile and Stereotypes tab. Here you may define your own stereotypes and
edit them.
In the element Specification dialog box, Stereotypes tab, click the Edit button.
Select the desired profile and Stereotypes tab.
5-326
UML DIAGRAMS
UML Extension Mechanisms
Edit
Add
Remove
OK
Saves all actions performed during the session and exits the dialog
box.
Cancel
Cancels all actions performed during the session and exits the dialog
box.
Help
5-327
UML DIAGRAMS
UML Extension Mechanisms
Class
Description
A server page represents a Web page that has scripts executed by the
server. These scripts interact with resources on the server (databases,
business logic, external systems, etc). The object operations represent
the functions in the script, and its attributes represent the variables that
are visible in the pages scope (accessible by all functions in the page).
Icon
Class
Description
Icon
Form Stereotype
Metamodel
Class
Class
Description
A class with stereotype form is a collection of input fields that are part
of a client page. A form class maps directly to the HTML form tag. Its
attributes represent the HTML form input fields (input boxes, text areas,
radio buttons, check boxes, and hidden fields).
A form has no operations - they cannot be encapsulated in a form. Any
operations that interact with the form would be the property of the page
that contains the form.
Icon
5-328
UML DIAGRAMS
UML Extension Mechanisms
Class
Description
Icon
Target Stereotype
Metamodel
Class
Class
Description
Icon
JavaScript Stereotype
Metamodel
Class
Class
Description
On a JavaScript enabled browser it is possible to simulate userdefined objects with JavaScript functions.
Icon
Link Stereotype
Metamodel
Class
5-329
Association
UML DIAGRAMS
UML Extension Mechanisms
Description
Icon
None
5-330
UML DIAGRAMS
UML Extension Mechanisms
Association
Description
Icon
None
Association
Description
Icon
None
Submit Stereotype
Metamodel
Class
Association
Description
Icon
None
Builds Stereotype
Metamodel
Class
Association
Description
Icon
None
Redirect Stereotype
Metamodel
Class
5-331
Association
UML DIAGRAMS
UML Extension Mechanisms
Description
Icon
None
5-332
UML DIAGRAMS
UML Extension Mechanisms
Object Stereotype
Metamodel
Class
Association
Description
Icon
None
IIOP Stereotype
Metamodel
Class
Association
Description
Icon
None
RMI Stereotype
Metamodel
Class
Association
Description
Icon
None
Attribute
Description
Icon
None
Attribute
Description
An input control used in forms. The select control allows the user
to select one or more items from a list. Most browsers render this
control as a combo or list box.
5-333
UML DIAGRAMS
UML Extension Mechanisms
Icon
None
Attribute
Description
Icon
None
Page Stereotype
Metamodel
Class
Component
Description
Icon
Ta g d e f i n i t i o n s
A tag definition specifies the tagged values that can be attached to a kind of model
element. Among other things, tag definitions can be used to define the virtual meta
attributes of the stereotype to which they are attached.
A tagged value adds extra information to a model element that is secondary to the
elements semantics. It is often used to store management data about the state and
progress of the project such as author, status, and tested. A tagged value is another way of
adding language implementation data to a model for code generation tools.
A tag definition consist of two parts: name and value (example: Author = Joe). There are
certain tags predefined in UML, others can be defined by the user.
Add tag definitions in the Tagged Values tab of model element Specification dialog box.
5-334
UML DIAGRAMS
UML Extension Mechanisms
DIALOG BOX
In the Profiles dialog box, Tag Definitions tab, click the Add or Edit button.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
Function
General
Set general
information about
the tag definition
Name
Multiplicity
Type
5-335
UML DIAGRAMS
UML Extension Mechanisms
Tab name
Box name
Function
Default Value
Show In
Diagrams
Base Classes
Select base classes you want to assign to the current tag definition from
the All list to the Selected list
Typed Values
The tagged values
that conform to
this tag definition.
Value
Owner
Edit
DIALOG BOX
In the Tag Definition Specification dialog box, Typed Values tab, click the Edit
button.
In the Tagged Values tab of the Specification dialog box, click the the Value
button.
5-336
UML DIAGRAMS
UML Extension Mechanisms
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box name
General
Tag Definition
Set general
information about
the tagged value
Function
HTML
Value
Edit
Add
Adds a value.
Remove
DIALOG BOX,
TAG DEFINITIONS
TAB
5-337
From the Tools menu, choose Profiles, then Tag Definitions tab, and then click
Edit.
UML DIAGRAMS
UML Extension Mechanisms
In the elements Specification dialog box, Tagged Values tab, click the Edit
Tag Definitions button.
Element name
Function
For
Available
Edit
Edit the selected tag definitions in the Tag Definition Specification dialog
box.
Add
The Tag Definition Specification dialog box appears. Add a new tag
definition to the selected model element.
Remove
OK
Attaches the selected tag definition to the particular element and exits the
dialog box.
Cancel
Cancels all actions performed during the session and exits the dialog box.
Help
5-338
UML DIAGRAMS
UML Extension Mechanisms
TODO ITEM
MagicDraw presents a TODO list. It is so called a list of tasks needed to do in the future
and added by the user. In MagicDraw, TODO tasks are added as tag definitions with a
name TODO, where a value is a text you need to use in the future.
5
6
7
Constraints
A constraint is a semantic condition or restriction on model elements that must be enforced
by a correct design of a system. It is represented as a linguistic, enclosed in braces ({}),
statement in some formal (OCL, C++, and other), or natural language. There are 14
standard constraints in the UML such as association, global, parameter. You may also
define your own constraints.
5-339
UML DIAGRAMS
UML Extension Mechanisms
Object Constraint Language (OCL) is a formal language used to express constraints. These
typically specify invariant conditions that must hold for the system being modeled.
OCL can be used for a number of different purposes:
To describe Guards
As a navigation language
Edit constraints in the Constraints tab of model element Specification dialog box.
5-340
UML DIAGRAMS
UML Extension Mechanisms
CONSTRAINT SPECIFICATION
DIALOG BOX
Refere to the Section Specification dialog boxes on page 4-133 for the information of the
specification elements not covered in this section.
Tab name
Box
Function
General
Name
Set general
Expression
information about
the constraint
Check OCL
Syntax
Base Classes
The list of model
elements to which
the constraint can
be applied.
All
>
<
>>
<<
Selected
5-341
UML DIAGRAMS
UML Extension Mechanisms
Tab name
Box
Function
Constrained
Elements
The list of
elements subject
to the constraint
Name
Type
Edit
From the Tools menu, choose Profiles and then Constraints tab.
Click the ... button in the elements Specification dialog box, Constraints tab.
5-342
UML DIAGRAMS
UML Extension Mechanisms
The Constraints tab of the Profiles dialog box contains the following elements.
Element name
Function
For
Available
Edit
Add
Remove
OK
Attaches the selected constraint to the particular element and exits the
dialog box.
Cancel
Help
5-343
UML DIAGRAMS
UML Extension Mechanisms
5-344
5-345
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-346
5-347
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-348
5-349
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-350
5-351
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-352
5-353
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-354
5-355
UML DIAGRAMS
UML Extension Mechanisms
UML DIAGRAMS
UML Extension Mechanisms
5-356
EXTENSION DIAGRAMS
MagicDraw supports an extension to UML diagrams:
Content diagram
Robustness diagram
Time diagram
Web diagram
DDL diagram
WSDL diagram
Patterns
Various types of classes you may create in every class diagram using a Pattern Wizard. It
contains GOF, Java, Junit, CORBA IDL, XML Schema, and WSDL design patterns.
You may also create new patters and edit existing ones using Java code or JPython scripts.
For a detailed description, see MagicDraw Open Api users guide.
The detailed description of the Pattern Wizard, see in Section Pattern Wizard on
page 7-432.
From the class shortcut menu, choose Tools and then choose the Apply Pattern
subcommand.
Select a class and choose Apply Pattern from the Tools main menu.
6-358
EXTENSION DIAGRAMS
Content Diagram
CONTENT DIAGRAM
A Content Diagram is an extension of UML notation. The purpose of it is to generate or
represent a project structure (diagrams) and relations between them. Content table works
as a table of contents for a project.
All created diagrams have their own Specifications, in which you may specify their name,
documentation, view relationships in which they participate, also add stereotypes, tagged
values and constraints.
6-359
EXTENSION DIAGRAMS
Content Diagram
Button (Hot
key)
Notation
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
6-360
EXTENSION DIAGRAMS
Content Diagram
Toolbar Button
Button (Hot
key)
Notation
Content Shape
Creates a table
of contents of
all diagrams of
the project.
Package
Dependency
A relationship
showing that
one diagram
depends on the
other.
Class Diagram
Creates a class
diagram.
Use Case
Diagram
Creates a use
case diagram.
Collaboration
Diagram
Creates a
collaboration
diagram.
Sequence
Diagram
Creates a
sequence
diagram.
6-361
EXTENSION DIAGRAMS
Content Diagram
Toolbar Button
Button (Hot
key)
Notation
State Diagram
Creates a state
diagram.
Activity Diagram
Creates an
activity
diagram.
Implementation
Diagram
Creates an
implementation
diagram.
Time Diagram
Creates a time
diagram.
Web Diagram
Creates a web
diagram.
CORBA IDL
Diagram
Creates a
CORBA IDL
diagram.
WSDL Diagram
Creates a WSDL
diagram.
XML Schema
Diagram
Creates a xml
schema
diagram.
6-362
EXTENSION DIAGRAMS
Robustness Diagram
Toolbar Button
Button (Hot
key)
Notation
Robustness
Diagram
Creates a
robustness
diagram.
DDL Diagram
Creates a DDL
diagram.
Content
Diagram
Creates a
content
diagram.
Separator
(W)
ROBUSTNESS DIAGRAM
Robustness Analysis involves analyzing the narrative text of use cases, identifying a firstguess set of objects that will participate in those use cases, and classifying these objects
based on the roles they play.
Boundary or Interface objects are what actors use in communicating with the
system.
Control objects (which usually are called controllers because they often aren't
real objects), which serve as the glue between boundary objects and entity
objects.
Robustness analysis serves as preliminary design within the project life cycle and provides
the missing link between analysis and detailed design.
Four basic rules apply:
Actors can only talk to boundary objects.
Boundary objects can only talk to controllers and actors.
Entity objects can only talk to controllers.
Controllers can talk to boundary objects and entity objects, and to other
controllers, but not to actors
Both boundary objects and entity objects are nouns, and that controllers are verbs. Nouns
cannot talk to other nouns, but verbs can talk to either nouns or verbs.
1
2
3
4
6-363
EXTENSION DIAGRAMS
Robustness Diagram
Ro b s t n e s s D i a g r a m E l e m e n t s
Toolbar Button/Model Element
Notation
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
Actor
An actor represents a role
played by an external person,
process or a thing interacting
with a system. One physical
object may play several roles.
(A)
6-364
EXTENSION DIAGRAMS
Web Diagram
Boundary
Actors use boundary objects to
communicate with the system
(sometimes called interface
objects.)
Class with stereotype
boundary
(B)
Control
Serves as the glue between
boundary objects and entity
objects.
Class with stereotype control
Entity
Entity objects usually are
objects from the domain
model.
Class with stereotype entity
Robustness Association
Association with default
Association End A navigability
= false and Association End B
navigability = true values.
Notation
(C)
(E)
(S)
Separator
(W)
WEB DIAGRAM
Web system consists from server applications, network, communicating protocol, and
browser. Basically, users requests begin from starting browser and requesting document
through network from server (host computer). Web server running on host computer,
catches user request, locates document and delivers it to the requestor.
UML is a standard language for modeling software. However modeling specific web
components cannot be done using just standard UML. Web-UML diagram provides
extension to UML model, which enables to model web applications.
MagicDraw Web-UML diagram includes Web-UML elements (stereotyped UML elements)
for modeling: client, server pages, web form, frame classes, java script class representation
and target class, and web page component.
The detailed description of all stereotypes, find in the Section UML Web Extension
stereotypes on page 5-327.
6-365
EXTENSION DIAGRAMS
Web Diagram
Reference: Building Web Applications with UML by Jim Conallen Copyright 2000 by
Addison Wesley Longman, Inc.
6-366
EXTENSION DIAGRAMS
Web Diagram
We b D i a g r a m El e m e n t s
Toolbar
Button/Model
Element
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
6-367
EXTENSION DIAGRAMS
Web Diagram
Toolbar
Button/Model
Element
Client Page
(SHIFT+C)
Server Page
(SHIFT+S)
Form
(SHIFT+F)
Frame
(SHIFT+E)
Target
(SHIFT+T)
Java Script
(SHIFT+J)
Class
(C)
6-368
EXTENSION DIAGRAMS
Web Diagram
Toolbar
Button/Model
Element
Interface
(I)
Package
(P)
Subsystem
(Y)
Model
(M)
Realize
(R)
Realization
(E)
Dependency
(D)
Generalization
(G)
Association
(S)
Aggregation
A
Composition
(F)
6-369
EXTENSION DIAGRAMS
Web Diagram
Toolbar
Button/Model
Element
Builds
(B)
Link
(L)
Targeted Link
(SHIFT+L)
Frame Content
(SHIFT+O)
Submit
(U)
Object
(O)
RMI
(SHIFT+R)
IIOP
(SHIFT+I)
6-370
EXTENSION DIAGRAMS
CORBA IDL Diagram
Toolbar
Button/Model
Element
Page
(SHIFT+P)
Separator
(W)
6-371
EXTENSION DIAGRAMS
CORBA IDL Diagram
Button (Hot
key)
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
CORBA IDL Module
(M)
6-372
EXTENSION DIAGRAMS
CORBA IDL Diagram
Toolbar Button/
Model Element
Button (Hot
key)
Value Support
Generalization
CORBA IDL
Association
Association
(S)
Aggregation
(A)
Composition
(F)
Package
(P)
6-373
EXTENSION DIAGRAMS
DDL Diagram
Toolbar Button/
Model Element
Button (Hot
key)
Class
(C)
Interface
(I)
Dependency
(D)
Binding Dependency
(B)
Containment
(SHIFT+C)
Separator
W
D D L D IA G R A M
DDL diagram is used to draw database definition elements. DDL diagram simplifies
creation of primary key, foreign key, triggers and etc.
The detailed description about DDL usage in MagicDraw, see MagicDraw Code
Engineering Users Guide, Chapter DDL Script Engineering.
6-374
EXTENSION DIAGRAMS
DDL Diagram
Button (Hot
key)
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
Table
(T)
6-375
EXTENSION DIAGRAMS
WSDL Diagram
Toolbar Button/
Model Element
Button (Hot
key)
View
(V)
Relationship
(R)
Foreign Key
(F)
database
(D)
schema
(S)
Separator
W
WSDL DIAGRAM
WSDL diagram is used to draw WSDL elements. Allows to create all elements used in wsdl
file, except schema. Schema elements can be created using XMLSchema diagram. WSDL
plugin has pattern for creating binding element.
WSDL plugin requires XMLSchema plugin.
6-376
EXTENSION DIAGRAMS
WSDL Diagram
Button (Hot
key)
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
WSDLmessage
(M)
6-377
EXTENSION DIAGRAMS
WSDL Diagram
Model Element
Button (Hot
key)
WSDLporttype
(T)
WSDLbinding
(B)
WSDLport
(SHIFT+P)
WSDLservice
(S)
WSDLdefinitions
(D)
WSDLtypes
(Y)
WSDLimport
(I)
Xmlns
(SHIFT+L)
XDSnamespace
(P)
Realization
(E)
Separator
(W)
6-378
EXTENSION DIAGRAMS
XML Schema Diagram
6-379
EXTENSION DIAGRAMS
XML Schema Diagram
Button (Hot
key)
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
Class by Pattern
(SHIFT+P)
XSDcomplexType
(C)
6-380
EXTENSION DIAGRAMS
XML Schema Diagram
Toolbar Button/
Model Element
Button (Hot
key)
XSDsimpleType
(S)
XSDsimpleType(XSDlist)
(SHIFT+S)
XSDsimpleType(XSDunion)
(U)
XSDall
(L)
XSDchoice
(O)
XSDsequence
(Q)
XSDgroup
(G)
XSDattributeGroup
(T)
XSDschema
(SHIFT+M)
Containment
(SHIFT+C)
XSDnamespace
(P)
6-381
EXTENSION DIAGRAMS
Time Diagram
Toolbar Button/
Model Element
Button (Hot
key)
Aggregation
(A)
Composition
(F)
Binding Dependency
(B)
XSDrestriction
(R)
XSDextension
(E)
XSDimport
(M)
XSDinclude
(D)
XSDredefine
(SHIFT+F)
xmlns
(SHIFT+L)
Separator
W
T IM E D I A G R A M
6-382
EXTENSION DIAGRAMS
Time Diagram
Ti m e D i a g r a m E l e m e n t s
Toolbar Button/
Model Element
Button (Hot
key)
Sticky Button
(Z)
Selection
(Escape)
Text Box
(X)
Text Box
(HTML Text)
(SHIFT+X)
Note
(N)
Note
(HTML Text)
(SHIFT+N)
Anchor to Note
(H)
Constraint
(SHIFT+H)
Classifier Role
(O)
Classifier Role
<<CRconcurrent>>
6-383
EXTENSION DIAGRAMS
Time Diagram
Toolbar Button/
Model Element
Button (Hot
key)
Classifier Role
<<SAshedRes>>
Concurrent Lifeline
(L)
Message: synchronous
uninterpreted
(M)
Message <<RTevent>>,
<<CRimmediate>>
Message
<<CRimmediate>>
Message <<SAtrigger>>
)
Message to Self:
synchronous
uninterpreted
(S)
Recursive Message
(R)
Diagonal Message:
synchronous
uninterpreted
(D)
Separator
W
6-384
TOOLS
MagicDraw provides the following tools and wizards to help you perform the design tasks in
your job quickly and easily:
Reports prepares HTML, PDF, or RTF report documents describing the model.
Class Diagram Wizard helps to create and customize new class diagrams.
Content Diagram Wizard - generates content of diagrams that are used in the
project.
Pattern Wizard creates various GOF, Java, Junit, CORBA IDL, and XML
Schema design patterns.
Creating Setters / Getters creates getting and setting operators for attributes
defined in the class.
Model Transformation Wizard - is a data set, which fully describes the action of
applying model transformation on a set of packages. Transformation type,
parameters, packages set to transform and the destination of the model
transformation results are the parts of model transformation.
REPORTS
The Report dialog box is used for selecting the options to generate a report of the opened
project to the HTML, PDF, RTF, XSL-FO, and PostScirpt formats.
MagicDraw report generation is based on XSL transformation and formatting.
7-386
TO O L S
Reports
In XSL transformation, an XSLT processor reads XML document and XSLT style sheet. The
processor outputs new XML document based on the instructions it finds in the XSLT style sheet.
There is also special support for HTML output.
In XSL formatting, XML data is formatted for output to screen, paper or other media.
The figure below shows the report generation mechanism.
Since version 7.1, it is possible to generate reports from command line - Report Generator tool
is presented. The description about Report Generator tool, see in Section Report Generator
Tool on page 7-404.
Te m p l a t e M a n a g e m e n t t a b
The Report dialog box allows you to select from an array of predefined report templates (styles),
or you can create your own report template. The information in the Template Management tab
7-387
TO O L S
Reports
is organized into trees. You may edit, delete, import, export, create your own template,
make one of the templates as the default one.
Model Report. Describes your UML model from different viewpoints, which
are already predefined in MagicDraw or you may create your own.
Predefined templates:
7-388
TO O L S
Reports
NOTE
7-389
TO O L S
Reports
7-390
TO O L S
Reports
DOCUMENT OPTIONS
Property Name
Description
Report Title
Document Title
Company Name
Footer Text
Revision Number
Revision Details
Revision Author
Select this check box, if you want that the number of pages
will be displayed as e.g. 5-26.
Table of Contents
Location
Documentation as HTML
Only for model report.
Include Documentation
Only for model report.
Preformatted
Documentation
Only for model report.
Show Introduction Section Includes Introduction section with Purpose, Scope and
Overview subsections (if selected).
Only for use case report,
software design description,
and model extension report.
7-391
TO O L S
Reports
Property Name
Description
Document Purpose
Document Scope
Only for use case report,
software design description,
and model extension report.
Show Overview
Subsection
Document Overview
Only for use case report and
software design description.
Include MagicDraw
Trademark
MODEL REPORT
Elements
Every Model Report template contains the specific list of elements (diagrams and model
elements), which information will be included in the report. You may select elements
that will be included in the report in the Elements section.
NOTE
The list includes only those elements that contains unique data. E.g. you may
not select Class, Implementation, and Sequence diagrams in this list as they
do not contain specific data. You may include images of those diagrams in
the Select Diagrams tab.
Element name
Activity Diagram
Actor
Artifact
Attributes
Classifier Role
Class
Collaboration Diagram
Comment
Component
7-392
TO O L S
Reports
Element name
Component Instance
Constraint
Data Types
Enumeration
Enumeration Literal
Extension Point
Instance
Interface
Node
Node instance
Operation
Relations
Sequence Diagram
Signal
State Diagram
Stereotype
Tag Definition
Use Case
Function
Filter By Visibility
Show Leaf
7-393
TO O L S
Reports
Option name
Function
Show Root
Show Abstract
Use case model diagrams represents use case model of the system.
These a
Open the Report dialog box, select Use Case Report, and then click the Model
Enrichment button.
Model Options
In the Model Options tab, select the sections that will be included in the Use Case Report.
Property name
Show Actors
Section
Show Package
Details
7-394
TO O L S
Reports
2 Scope
3 Overview
4 System Overview
5 Design Considerations
5.1 Assumptions and Dependencies
6 General Constraints
7 Goals and Guidelines
8 Architectural Strategies
9 System Architecture
9.1 Use Case View
10Conceptual View
11Deployment View
12Process View
13Detailed Design
13.1 Design Model
13.1.1 Component View
13.1.2 Data
13.1.3 MagicDraw Profile
13.1.4 UML Standard Profile
14Implementation Model
7-395
Option name
Function
System Overview
Click the ... button and type the text you want to be
displayed in the System Overview section.
TO O L S
Reports
Option name
Function
Show Dependencies
Subsection
System Dependencies
Click the ... button and type the text you want to be
displayed in the Dependencies section.
System Constraints
Click the ... button and type the text you want to be
displayed in the System Overview section.
System Goals
Click the ... button and type the text you want to be
displayed in the Goals section.
Architectural Strategies
Click the ... button and type the text you want to be
displayed in the Strategies section.
Show Process View Subsection Includes Process View subsection in the report. Select the
diagrams that represent Process View in the Software Design
Model Wizard.
Show Detailed Design Section Includes Detailed Design
Show Design Model
7-396
TO O L S
Reports
Option name
Function
7-397
Property name
Show
Stereotypes
Stereotypes
Table Style
Show Tag
Definitions
Show Global
Tag Definitions
TO O L S
Reports
S e l e c t Pa c k a g e s t a b
From the Select Package tab, select one package from which you want the report will be generated.
By default, the Data package is selected and all model elements are included in the report.
7-398
TO O L S
Reports
7-399
TO O L S
Reports
Element name
Function
Report File
Enter the directory and the name of the report where the generated report
will be saved, or click the button, to select the location directory and
the file name in the Open dialog box.
NOTE
Follow the file naming rules of the operation system you
are using. If an incorrect name is provided, MagicDraw
notifies you with the error message.
7-400
TO O L S
Reports
Element name
Function
Report Output
Format
Report Paper
Size
Choose the size or paper for all reports, excluding HTML reports.
Page
Orientation
Generate
Export
Display in
Viewer
Save
Configuration
Customize the report and save its configuration if you want to generate the
report from command line, or you would like other users to use your
configuration.
Select
Configuration
Close
Help
Re p or t C u st o m i z a t i o n
There is possibility to customize MagicDraw reports by editing XSL files.
The final report generation result is determined by the three parameters: report type (e.g.
Model Report), report style (e.g. Default) and report output format (e.g. PDF).
Each report type can have one ore more report styles, and each report style can have up to
six report output formats (HTML browsable and printable, XSL Formatting Objects, PDF, PS
and RTF).
7-401
TO O L S
Reports
The concrete values of these three parameters (report type, style and output format)
define the location of the "Main.xsl" file. MagicDraw takes the project file (XML) and
appropriate "Main.xsl" file (XSLT) as input for report generation.
The "Main.xsl" file location pattern is:
<MD_install_dir>/data/report/report_types/<reportType>/xsl/<reportStyle>/<outpu
tFormat>/Main.xsl,
-where
Report
Style
Output Format
Model Report
Default
HTML Browsable
Model
Report/xsl/Default/HTML_BROWSABLE
Model Report
Default
HTML Printable
Model
Report/xsl/Default/HTML_PRINTALBE
Model Report
Default
XSL Formatting
Objects
Model Report/xsl/Default/XSL_FO
Model Report
Custom
XSL Formatting
Objects
Model Report/xsl/Custom/XSL_FO
XSL Formatting
Objects
NOTE
There is no need to have separate XSL files for PDF, PS and RTF output
formats, as XSL-FO is converted to one of these formats by FO formatter.
NEW REPORT
Task:
Add new report style (named "My Style") for Model Report. Only HTML browsable report
output format will be implemented.
Implementation:
Step Create item
Where
Item Description
"<MagicDraw install
dir>/data/report/report_types/
Model Report/xsl
Directory "My
Style
7-402
TO O L S
Reports
Where
Item Description
Directory
"<MagicDraw install
"HTML_BROW dir>/data/report/report_types/
SABLE
Model Report/xsl/My Style
XSL file
"Main.xsl
"<MagicDraw install
dir>/data/report/report_types/
Model Report/xsl/My
Style/HTML_BROWSABLE
After completion of these steps the new item "My Style" in the "Report Style" combo box (for
"Model Report") will be available. Select this style and the "HTML Browsable" report output
format to make MagicDraw use the newly created (or customized) XSL file for report
generation.
NOTE
7-403
TO O L S
Reports
2. Registering fonts
FOP should know how to find and use the font metrics files. It is done by registering them.
Add entries for your custom fonts, regardless of font type, to the configuration file
(data/report/conf/userconfig.xml) in a manner similar to the following:
<font metrics-file="tahoma.xml" kerning="yes"
embed-file="C:\WINNT\Fonts\tahoma.ttf">
<font-triplet name="Tahoma" style="normal" weight="normal"/>
</font>
Re p o r t G e n e r a t o r Too l
STARTING REPORT GENERATOR
Report generator launcher is generate_reports.exe. It requires to pass project and config
parameters. Project parameter value is path to project file. config parameter value is path
to report configuration file. For example:
generate_reports.exe -Dproject=c:\test\project.xml.zip Dconfig=c:\config.properties
7-404
TO O L S
Class Diagram Wizard
Description
GENERATE_ALL_DIAGRAMS
GENERATE_RECURSIVELY
PAGE_SIZE
REPORT_STYLE
Style name
REPORT_PACKAGES
REPORT_FILE
IMAGE_FORMAT
REPORT_PROPERTIES
REPORT_TYPE
DIAGRAM_LIST
OUTPUT_FORMAT
Generated reports are placed in the same directory where MagicDraw UML is installed
or you may choose other directory.
7-405
TO O L S
Class Diagram Wizard
Type or leave the default the name of a new diagram in the Type Class Diagram name text
box.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package
that will be the parent for the newly created diagram from the Data tree or create a new
package by clicking the New button.
Buttons available in the Class Diagram Wizard, parent package window:
7-406
TO O L S
Class Diagram Wizard
Selected list contains all the elements that are added to the class diagram.
7-407
Add adds selected model elements from the All to the Selected list.
Add All adds all elements located in the same hierarchy level as the selected
element to the Selected list.
Add Recursively adds all selected elements in the selected package and all
elements from nested packages to the Selected list.
<Back returns to the previous dialog box. Correct data entered in the previous
step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Class Diagram Wizard exits and the created class diagram is
displayed.
TO O L S
Class Diagram Wizard
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options
will be set by default. The Class Diagram Wizard exits and the created class
diagram is displayed.
7-408
TO O L S
Class Diagram Wizard
If the Suppress Attributes and the Suppress Operations check boxes are selected,
the class is displayed only as a rectangular with the class name in it.
7-409
Reset To Defaults - if changes were made to element properties, values will be set
to default.
<Back returns to the previous dialog box. Correct data is entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Class Diagram Wizard exits and the created class diagram is
displayed.
TO O L S
Package Dependency Wizard
Type the name for a newly created diagram in the Type Class Diagram name text box.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package
that will be the parent for the newly created diagram from the Data tree or create a new
package by clicking the New button.
Buttons available in the Package Dependency Diagram Wizard, specify name and
package window:
7-410
TO O L S
Package Dependency Wizard
Selected list contains all packages that are added to the diagram.
Buttons available in the Package Dependency Diagram Wizard, selected packages window:
7-411
Add adds selected package from the All to the Selected list.
Add All adds all packages located in the same hierarchy level as the selected
element to the Selected list.
Add Recursively adds all selected elements in the selected package and all
elements from nested packages to the Selected list.
<Back returns to the previous dialog box. Correct data, entered in the previous
step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Package Dependency Diagram Wizard exits and the created
class diagram is displayed.
TO O L S
Package Overview Diagram Wizard
Reset To Defaults - if changes were made to element properties, values will be set
to default.
<Back returns to the previous dialog box. Correct data is entered in the previous
step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Package Dependency Diagram Wizard exits and the created
class diagram is displayed.
Choose the Package Overview Diagram Wizard from the Diagrams menu,
Diagram Wizards submenu.
7-412
TO O L S
Package Overview Diagram Wizard
Invoke the package shortcut menu, choose Tools and then Package Overview
Diagram Wizard.
From the Tools menu, choose the Model Visualizer command. The Model
Visualizer dialog box appears. In the wizards list, select the Package Overview
Diagram Wizard. Double click or in the Model Visualizer dialog box, click the Start
button.
Type the name for a newly created diagram in the Type Class Diagram name text box.
The Add diagrams into their own package option button -while creating new package
overview diagrams, adds diagrams in the same package they are created.
The Add all diagrams into selected package - while creating new package overview diagrams,
add diagrams in the selected package. Choose the package that will contain the created
diagram. The hierarchy of UML model packages is displayed in the Select package for
diagram list window. Choose the package that will be the parent for the newly created
diagram from the Data tree or create a new package by clicking the New button.
Buttons available in the Package Overview Diagram Wizard, specify name and package
window:
7-413
TO O L S
Package Overview Diagram Wizard
Select the packages, which will be represented in new diagram. For every selected package
diagram will be created.
If some selected package is read-only and package for diagrams is not specified, warning
on pressing the Next button will be displayed
Buttons available in the Package Overview Diagram Wizard, selected packages window:
<Back returns to the previous dialog box. Correct data, entered in the previous
step.
7-414
TO O L S
Package Overview Diagram Wizard
7-415
<Back returns to the previous dialog box. Correct data is entered in the previous
step.
Finish finishes the configuration of your diagram. All other options will be set by
default. The Package Overview Diagram Wizard exits and the created diagram is
displayed.
TO O L S
Package Overview Diagram Wizard
Buttons available in the Package Overview Diagram Wizard, select relationships window:
<Back returns to the previous dialog box. Correct data is entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Package Dependency Diagram Wizard exits and the created
class diagram is displayed.
7-416
TO O L S
Tools for Analysis
<Back returns to the previous dialog box. Correct data is entered in the
previous step.
Finish finishes the configuration of your diagram. All other options will be set
by default. The Package Overview Diagram Wizard exits and the created
diagram is displayed.
7-417
TO O L S
Tools for Analysis
H i e r a r c h y D i a g r a m Wi z a r d
The Hierarchy Diagram Wizard collects largest hierarchies and allows to display every of them
as separate diagram or all in one diagram.
From the Diagrams main menu, choose the Diagram Wizards command and then
Hierarchy Diagram Wizard.
From the Tools menu, choose the Model Visualizer command. The Model Visualizer
dialog box appears. From the wizards list, select the Hierarchy Diagram Wizard.
From the model element shortcut menu, choose Tools and then Hierarchy Diagram
Wizard.
Type the name for a new diagram in the Type diagram name field.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package that
will be the parent for the newly created diagram from the Data tree or create a new package by
clicking the New button.
Buttons available in the Hierarchy Diagram Wizard, specify name and package window:
7-418
TO O L S
Tools for Analysis
Select packages where to search hierarchy elements and add the from the All to the
Selected list.
Buttons available in the Hierarchy Diagram Wizard, select scope window:
7-419
<Back returns to the previous dialog box. Correct the data entered in the
previous step.
TO O L S
Tools for Analysis
The Add all hierarchies into one diagram check box creates only one diagram for all selected
hierarchies. This option is enabled only if selected hierarchies can be added into one diagram
(the same diagram type).
All available hierarchies are listed in the Parent Element column. In the Children Count
column, number of model elements is presented.
The Show outside parent check box shows hierarchies, when derived packages are in the
scope, but specializations is from outside scope.
The Show outside children check box counts outside derived elements from displayed
hierarchies. Otherwise hierarchy will be not fully displayed and diagram may be not valid.
Buttons available in the Hierarchy Diagram Wizard, select hierarchy window:
<Back returns to the previous dialog box. Correct data, entered in the previous
step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Hierarchy Diagram Wizard exits and the generation starts.
7-420
TO O L S
Tools for Analysis
Reset To Defaults - if changes were made to elemet properties, values will be set
to default.
<Back returns to the previous dialog box. Correct data is entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Hierarchy Diagram Wizard exits and the created diagram is
displayed.
Re a l i z a t i o n D i a g r a m Wi z a r d
The Realization Diagram Wizard shows table of largest elements groups that realizes some
interface.
7-421
From the Diagrams main menu, choose the Diagram Wizards command and
then Realization Diagram Wizard .
TO O L S
Tools for Analysis
From the Tools menu, choose the Model Visualizer command. The Model
Visualizer dialog box appears. From the wizards list, select the Realization
Diagram Wizard.
From the model element shortcut menu, choose Tools and then Realization
Diagram Wizard.
Type the name for a new diagram in the Type diagram name field.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package
that will be the parent for the newly created diagram from the Data tree or create a new
package by clicking the New button.
Buttons available in the Realization Diagram Wizard, specify name and package window:
7-422
TO O L S
Tools for Analysis
Select packages where to search hierarchy elements and add the from the All to the
Selected list.
Buttons available in the Realization Diagram Wizard, select scope window:
7-423
<Back returns to the previous dialog box. Correct the data entered in the
previous step.
TO O L S
Tools for Analysis
The Add all implementations into one diagram check box creates only one diagram for all
selected realizations. This option is enabled only if selected realizations can be added into
one diagram (the same diagram type).
All available implementations are listed in the Specialization Element column. In the
Implementations Count column, number of model elements is presented.
The Show outside specializations check box show realizations, when derived interfaces are
in the scope, but specializations is from outside scope.
The Show outside implementations check box count outside derived elements from
displayed realizations. Otherwise realization will be not fully displayed and diagram can be
not valid.
Buttons available in the Hierarchy Diagram Wizard, select hierarchy window:
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Realization Diagram Wizard exits and the generation starts.
7-424
TO O L S
Tools for Analysis
7-425
Reset To Defaults - if changes were made to elemet properties, values will be set
to default.
<Back returns to the previous dialog box. Correct data is entered in the
previous step.
Finish finishes the configuration of your class diagram. All other options will be
set by default. The Realization Diagram Wizard exits and the created diagram is
displayed.
TO O L S
Content Diagram Wizard
Diagram Wizard.
Type the name for a new diagram in the Type diagram name text box.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package
that will be the parent for the newly created diagram from the Data tree or create a new
package by clicking the New button.
Buttons available in the Content Diagram Wizard, type diagram name window:
7-426
TO O L S
Content Diagram Wizard
Select what types of the diagrams will be included to the content diagram.
Buttons available in the Content Diagram Wizard, types of diagrams window:
7-427
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
TO O L S
Sequence Diagram from Java Source Wizard
Add adds selected objects from the All list to the Selected list.
Add All adds all packages located in the same hierarchy level as the selected
element to the Selected list.
Add Recursively adds all selected elements in the selected package and all
elements from nested packages to the Selected list.
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
Finish finishes the configuration of your content diagram. All other options will
be set by default. The Content Diagram Wizard exits and the created content
diagram is displayed.
S E Q U E N C E D I A G R A M F R O M J A V A S O U R C E W IZ A R D
The Sequence Diagram from Java Source Wizard allows visualizing Java method
implementation with UML Sequence diagram. UML Sequence diagram can not show Java
code 100% correctly, so MagicDraw provides mechanism that generates diagram that
reflects essential of Java method content.
Create class with operation. Create new code engineering Java set. Add class to
this set. In the Browser, Code engineering sets tree, select the RTMethod node.
Invoke its shortcut menu. Select the Reverse Implementation command. The
Sequence Diagram from Java Source Wizard is opened (method is selected in
wizard).
7-428
TO O L S
Sequence Diagram from Java Source Wizard
Create class with operation. Select operation in the Browser. Invoke operation
shortcut menu, choose the Reverse Implementation command. The Sequence
Diagram from Java Source Wizard is opened (method is selected in wizard).
Figure 162 -- Sequence Diagram from Java Source Wizard. Specify Name and Package
Type the name for a new sequence diagram in the Type diagram name text box. By default,
name of the class and method will be given to the sequence diagram.
Choose the package that will contain the created diagram. The hierarchy of UML model
packages is displayed in the Select package for diagram list window. Choose the package
that will be the parent for the newly created diagram from the Data tree or create a new
package by clicking the New button.
Buttons available in the Sequence Diagram from Java Source Wizard, Specify Name and
Package window:
7-429
TO O L S
Sequence Diagram from Java Source Wizard
Figure 163 -- Sequence Diagram from Java Source Wizard. Select Operations.
Select method (operation), which will be displayed in the sequence diagram. If wizard is
invoked from operation shortcut menu or from Sequence diagram, operation and Java
source file is already selected.
In the Select Java source file field, specify the Java source file, if this file cannot be found
automatically.
Buttons available in the Sequence Diagram from Java Source Wizard, Select Operation
window:
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
7-430
TO O L S
Sequence Diagram from Java Source Wizard
Figure 164 -- Sequence Diagram from Java Source Wizard. Select Classes for Diagram.
The Analyze and split long expressions in diagram check box - if expression
contains calls and cannot be displayed as call message, then every call will be
shown as separate call message with temporary variable initialization. In final
expression message these calls will be replaced into appropriate temp variable
names.
The Create return message check box- displays return message for every call
message.
The Wrap message text check box - specifies the maximum message text length in
pixels, to wrap longer message.
Buttons available in the Sequence Diagram from Java Source Wizard, select classes for
diagram window:
7-431
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
Finish finishes the configuration of your sequence diagram. All other options
will be set by default. The Sequence Diagram from Java Source Wizard exits and
the created sequence diagram is displayed.
TO O L S
Pattern Wizard
NOTE:
<Back returns to the previous dialog box. Correct data, entered in the
previous step.
Finish finishes the configuration of your sequence diagram. All other options
will be set by default. The Sequence Diagram from Java Source Wizard exits and
the created sequence diagram is displayed.
You can extend created sequence diagram by method. Select method (message),
which you want to be displayed more detail including referenced classes and
other defining methods and from the message shortcut menu, choose Reverse
Implementation command. The Sequence Diagram from Java Source Wizard
appears.
PATTERN WIZARD
In MagicDraw, you may find various GOF, Java, Junit, CORBA IDL, and XML Schema
design patterns.
You may also create new patters and edit existing ones using Java code or JPython scripts.
For a detailed description, see MagicDraw Open Api users guide.
7-432
TO O L S
Pattern Wizard
Choose Tools from the class shortcut menu and then choose the Apply Pattern
subcommand.
Select a class and choose Apply Pattern from the Tools main menu.
The Pattern Wizard has three main collections of customizable options, which are represented
by hierarchy tree on the left side of the dialog box:
7-433
Category
Design
Pattern
Properties
Gof
Templates described in
the Design Patterns of
Reusable ObjectOriented Software
Adapter
Interface Class
Adapter Class
Adaptee Class
NOTE
The Next > button is activated.
In the Adapter Operations
screen, add or remove
operations you want to use.
TO O L S
Pattern Wizard
Category
Java
Specific Java design
patterns
Design
Pattern
Properties
Bridge
Abstraction
Implementor
Implementor is: Abstract Class or Interface
Name of Reference
Suffix of the Concrete Implementor
NOTE
The Next > button is activated.
In the Deriver Classes screen,
add or remove classes you want
to use.
Composite
Component Class
Composite Class
NOTE
The Next > button is activated.
In the Composite Operations
screen, add or remove
operations you want to use.
Decorator
Component Class
Decorator Class
Concrete Decorator Class
NOTE
The Next > button is activated.
In the Decorator Operations
screen, add or remove
operations you want to use.
Observer
Subject Class
Observer Class
Concrete Subject Class
Concrete Observer Class
Proxy
Subject Class
Proxy Class
Real Subject Class
NOTE
The Next > button is activated.
In the Proxy Operations screen,
add or remove operations you
want to use.
Singleton
Singleton class
Visitor
Visitor Class
Implementation Style: visit (MyClass),
visitMyClass (MyClass)
NOTE
The Next > button is activated.
In the Elements to Visit screen,
select classes and interfaces you
want to visit.
Main
Main class
7-434
TO O L S
Pattern Wizard
Category
Design
Pattern
Properties
EJB
7-435
Entity
Sichronize Names
EJB Name
EJB Class
Remote Interface
Home Interface
Local Interface
Local Home Interface
Display Name
Large Icon
Small Icon
Abstract Schema Name
Cmp Version
Persistence Type
Reentrant
Primary Key Class
Message
Driven
EJB Name
EJB Class
Display Name
Large Icon
Small Icon
Acknowledge Mode
Destination Type
Subscripting Durability
Message Selector
Transaction Type
Session
Sichronize Names
EJB Name
EJB Class
Remote Interface
Home Interface
Local Interface
Local Home Interface
Display Name
Large Icon
Small Icon
Session Type
Transaction Type
NOTE
The Next > button is activated.
In the Remote Methods screen,
add or remove operations you
want to use.
TO O L S
Pattern Wizard
Category
Design
Pattern
Properties
Java RMI
JUnit
TestCase
JUnit is a regression
testing framework. It is
used by the developer
who implements unit
tests in Java. JUnit is
Open Source Software.
The provided templates Tested
Class
let to create the
constructions,
implemented in the
JUnit framework. For
more information, look
at
http://www.junit.org.
TestCase Class
Create suite()
Create Constructor TestCase(String)
Create runTest()
Create setUp()
Create tearDown()
XML Schema
Specific XML design
patterns
Target Class
Content: XSDcomplex content, XSDsimple
content.
XSD
complex
Type
Tested Class
TestCase Class
Create suite()
Create Constructor TestCase(String)
Create runTest()
Create setUp()
Create tearDown()
NOTE:
The Next > button is activated.
In the Tested Operations pane,
add or remove operations you
want to use.
XSD
Target Class
compositor Compositor: XSDall, XSDchoice, XSDsequence
Particle
XSD
simpleType
Target Class
Content: XSDrestriction, XSDlist, XSDunion
XSD
simpleType
(XSDlist)
Target Class
Item Type
XSD
simpleType
(XSDunion)
Target Class
7-436
TO O L S
Pattern Wizard
Category
Design
Pattern
Properties
Simple
XSD
restricton
Target Class
Stereotype: XSDsimpleType, XSDsimpleContent
Base
Min Exclusive
Max Exclusive
Max Inclusive
Min Inclusive
Total Digits
Fraction Digits
Length
Min Length
Max Length
White Space
Pattern
WSDL
Specific WSDL design
pattern
Binding
CORBA IDL
Specific CORBA IDL
design patterns
Interface
Name
Abstract
Local Interface
Value Type
Name
Abstract
Custom Value Type
Type
Definition
Name
Type Definition Specifier: typedef, boxed value
Base Type
Sequence
Name
Base Type
Sequence Size
Anonymous
Array
Name
Base Type
Array Size
Anonymous
Fixed
Name
Digits
Scale
Anonymous
Union
Name
Discriminator Type
Enume
ration
Name
Struct
Name
Exception
Name
< Back
7-437
TO O L S
Creating Setters / Getters
Category
Design
Pattern
Properties
Next >
Finish
Cancel
Help
From the shortcut menu of the selected class, choose Tools, and then choose
Create Setters/Getters. The Select Attributes/Association Ends dialog box appears.
Box
Function
All
7-438
TO O L S
Implementing or Overriding Operations
Box
Function
Selected
>
Moves the selected attribute from the All list to the Selected list.
Setter for that attribute will be generated.
<
Moves selected attribute from the Selected list to the All list.
>>
Moves all attributes from the All list to the Selected list. Setters
for all of them will be generated.
<<
Prefix to Remove Type a prefix of an attribute (-, .) you want remove while
generating setters or getters.
Create Setters
Create Getters
OK
Cancel
Help
The names of created operations (setters) are combined according to the following format:
public void set + <attribute name> (<attribute type> <attribute name>)
For example, if you have an attribute called x of type int, then the generated setter will look
that way:
The names of created operations (getters) are combined according to the following format:
For example, if you have an attribute called x of type int, then the generated setter will look
this way:
7-439
When one classifier inherits operations from the base classifier (Generalization
relationship).
TO O L S
Model Transformation Wizard
Function
All
Selected
>
Moves the selected operation from the All list to the Selected list.
<
Moves selected operation from the Selected list to the All list.
>>
Moves all operations from the All list to the Selected list.
<<
OK
Cancel
Help
TIP!:
Double-click the item name, and it will be moved to the opposite list.
7-440
TO O L S
Model Transformation Wizar d
Any to Any - this transformations makes possibility to copy all or part of the
model to the other package without making changes or change destination
model by applying some transformation mapping rules.
UML to XML Schema - this transformation helps to create XML Schema models
from pure UML models. Basically this transformation is copying of source model,
and then applying necessary stereotypes according to the XML schema modeling
rules.
XML Schema to UML - derives pure UML model from XML Schema. It is copying
of the source model striping the unnecessary stereotypes. Reverse transformation
can loose some information in the destination model because derives more
abstract model from more specific.
Generic DDL to Oracle DDL - helps to create more specidic Oracle DDL
models from Generic DDL. In this transformation, mapping will be performed
using appropriate Oracle DDL types.
UML to Generic DDL - helps to create generic DDL models from UML models. It
is copying elements from the source to destination and applying appropriate
stereotypes. The transformation works only with classes, packages and
association relationships.
UML to Oracle DDL - helps to create Oracle DDL models from UML models. In
this transformation, mapping will be performed using appropriate Oracle DDL
types.
7-441
From the Tools main menu, choose the Model Transformations command.
Select the package(s), from the shortcut menu, choose Tools and then the
Transform command.
TO O L S
Model Transformation Wizard
The Transformation Source tree displays all project data - packages with inner elements,
which can be selected as source for transformation.
2005 No Magic, Inc
7-442
TO O L S
Model Transformation Wizar d
The Place transformation model in package radio button specifies the package to which
source will be transformed. Click the ... button to invoke the Destination Package dialog
box. Select existing package from the Packages tree or create a new one.
The Transform in place radio button specifies that source package structure will correspond
to destination package.
Buttons available in the Model Transformations Wizard, Select source/destination window:
Finish finishes the configuration of transformation. All other options will be set
by default. The Model Transformations Wizard exits and results of
transformation appear in the project.
The Transformation type map profile combo box displays default or manually created
mapping profiles, which specifies the mapping rules that should be applied to model during
transformation.
The From type and To type fields displays type mappings of the selected transformation
profile.
The Run type mapping in reverse order check box allows to make opposite type mapping in
transformation.
Buttons available in the Model Transformations Wizard, Select type mapping window:
7-443
Next> proceeds to the next step - Specify transformation details. (This button
is disabled in Any to Any transformation).
TO O L S
Model Transformation Wizard
The Transformation Details table displays various properties of specific transformation, selected
in the Model Transformation Wizard Step1. You can change the default value of the element
here.
The Reset to Defaults button changes transformation properties to default values.
Buttons available in the Model Transformations Wizard, Specify transformation details window:
7-444
TO O L S
Model Transformation Wizar d
typeMap>>.
3 Choose standard types, which will used in transformation mapping and create
dependency relationship from one type to another. Apply stereotype with name
<<map>> to dependency.
This example shows that after transformation, all int types will be transformed to char.
Note: To change behavior of the mapping, read the section
4 Start the Model Transformations Wizard. In Step 3 Select type mapping, open
the Transformation type map profile combo box and choose the package,
containing mapping rules.
5 Finish wizard. Transformation mapping according to created rules will be
performed to transformed model.
TRANSFORMATION MAPPING POSSIBILITIES
To change behavior of mapping, set appropriate tags on dependency relationship:
7-445
Default type mapping can be applied both ways. For example, if you have type
map from int to char, you may use it to change all int types to char. But if you
select the Run type mapping in reverse order check box in the Select type
mappings Step3 of the Model Transformation Wizard - type map will be applied
in reverse order - all char will be changed to int. To change such behavior,
create value for the direction tag in the Dependecy Specification dialog box.
2005 No Magic, Inc.
TO O L S
Model Transformation Wizard
Default value is "both". Change to "forward" to have this mapping valid only
forward or to "reverse" - for reverse only.
If you want to apply direction order for all dependencies, you may set value for
defaultDirection tag in the Package Specification dialog box. This package has
<<typeMap>> stereotype. At first direction tag is checked on <<map>>
dependency, then if not found - defaultDirection tag on <<typeMap>>
package and last default value is set.
You may have several <<map>> relationships from one source or to one
destination. In such case one of relationships must have "default" tag set.
Dependencies from one source without (or with several) default tag (set) are
invalid. Also dependencies to one destination with "reverse" or "both" direction
order set must have one with default tag.
Transitive mapping for the elements (eg. Type1 -> Type2 -> Type3) are not
supported.
You may also control mapping behavior of the type inheritance in source model.
By default, derived subtypes are also mapped by parent rule (unless of course
they have their own rules for mapping). If blockInheritedSourceTypes tagged
value is set - derived types are not affected by this rule.
Here T1, T2, T5 are types in the source domain T2, T4 - types in destination domain. Now,
having these two mappings (T1 ->T2 and T3 ->T4), the following is true: T1 and all the
types, derived from it (like T5) are mapped to the T2 type, except T3 and any of the types,
derived from it - these are mapped to the T4.
Now consider that blockInheritedSourceTypes is set:
7-446
TO O L S
Model Transformation Wizar d
In this case, T3 and types, derived from it are still mapped to the T4; the T1 is still mapped
to T2; but the T5 and all the other types, inherited from T1 are NOT mapped to T2, as in
previous case.
Here T1 is a type in the source domain, T2, T4 - types in the destination domain. Now,
having this mapping (T1 ->T2), on the first application of the transformation type T1 in the
source model will be mapped to type T2 in the destination model. Lets say, when user
refines the destination model - changes the type on the destination model attribute from T2,
to more specific - T4 (this situation will be rather common - for example, user refines
attribute type from string to basic URI in the XML schemas, or from Integer to
nonNegativeInteger, etc.). In essence, the mapping for inherited types of T2 is performed as
if there was a mapping T1->T2 (default), T1->T4,
T1-> any_other_type_inherited_from_T2.
Now consider that the blockInheritedDestinationTypes taged value is applied:
In this case, type T4 has no special treatment. If the user applies transformation, T1 is
mapped to T2. Lets say the user now refines destination model - changes attribute type from
T2 to T4. If the user now reapplies (updates destination) transformation, the attribute type
will be overwritten - T4 reset back to T2.
7-447
When user loads the type map in reverse direction, roles of the
"blockInheritedSourceTypes" and "blockInheritedDestinationTypes" are
transposed (unless of course "direction" mandates, that this mapping is not used
in reverse direction).
TO O L S
Model Transformation Wizard
A special type AnySourceType. This type is a template, it matches any type in the
source model (see mapping rules for type inheritance). By using this type,
together with the inheritance mapping rules, user can, for example, specify, that
any other types, that were not defined by the mapping should be interpreted by
this mapping. This rule says - any other type in the source model should be
stripped in the destination model.
From the destination package shortcut menu, choose Tools and then Update
Transformed Model. The Model refresh options dialog box appears:
7-448
TO O L S
Metrics
This update options works only for already created elements data (renaming,
changing type, etc.), which have type mapping dependencies. If new elements
are added to source, after update in both cases copies of new elements will be
created in destination model. If element was deleted from source, it will not be
removed in destination after update.
METRICS
MagicDraw metrics functionality allows measuring project by different viewpoints.
Three kinds of metrics are available:
System metrics
Requirements metrics.
UML model metrics consist of packages, classes, and diagrams measurement by different
points of view (e.g. number of classes, inheritance tree depth, etc.).
System metrics provides model analysis using most popular Object Oriented projects
metrics: Halstead, McCabe, Chidamber and Kemerer defined metrics (e.g. cyclomatic
complexity, weighted methods per class).
Requirements metrics consist of function points and use case metrics. As these two metrics
groups are very close to each other, it is considered that use case metrics are part of
function points metrics. Use case metrics measure the number of use cases in project and
user case analysis through selected tagged values (e.g. priority).
Analysis results are displayed in a table and user is able to select which metrics shall be
displayed. Also it is possible to export metrics to a file.
Metrics are implemented as a plugin and are accessible through Open API.
A metric is a digit that measures model or is counted according model measuring. Each
metric has lower metric limit and highest metric limit specified. Metrics that are out of
boundaries of these limits shall be marked:
Too high value font color is red. Note: if highest limit is equal 0, metric is never
be marked as too high (in red font color).
Metrics suites
Metric suites may be created in MagicDraw.
Metrics suite contains:
7-449
TO O L S
Metrics
There are three predefined metrics suites: System Metrics, UML Model Metrics and
Requirements Metrics.
You may create your own metrics suite by cloning existing suite and specifying suite
properties. You are also allowed to edit predefined metrics suites. All metric suites can be
imported or exported in order to exchange with other users.
Displaying metrics
Metrics are counted according properties defined in selected metrics suite. Metrics can be
counted for whole project or for selected packages, classes, interfaces or diagrams. The
results are displayed in the Metrics window, which is placed at the bottom of MagicDraw
application.
Metrics window contains two tabs:
Data tab. Counted metrics for selected suite is displayed. Metrics results are
displayed in a metrics table. Only counted metrics are included into metrics
table.
Metrics table displays packages, classes, interfaces and diagrams. Also elements that
contain packages, classes, interfaces and diagrams as inner elements shall be displayed to
depict tree structure, but metrics shall not be counted for these elements.
Metrics table structure:
Model Element
Metric1
Metric2
Metric3
MetricN
value
value
value
value
value
value
Inner class1
value
value
value
value
value
value
Inner class2
value
value
value
value
value
value
PackageA
If value may not be counted for a class, interface, package, or diagram, the cell is left
empty.
The results of the metrics table may be filtered by:
All
Packages
Diagrams
Class Violations only rows that contain classes and interfaces violations shall
be displayed.
7-450
TO O L S
Metrics
When filter Classes, Diagrams, or Class Violations is selected, the owner is displayed next
to element: c1 (Classes::Package1)
Invoking Metrics
To invoke Metrics functionality:
From the Tools menu, choose Metrics or from class/package/interface/diagram
shortcut menu, choose Tools, and then Metrics.
The Metrics dialog appears.
7-451
Element
Desription
Metrics Suite
All suits that are created in Metrics Suites dialog are available in
this combo box.
Calculate For
Metrics Options
Calculate
TO O L S
Metrics
Packages, classes and diagrams are displayed in this dialog. Selecting any element, selects
all elements recursively. Unselecting element, unselects elements recursively.
Unselecting the child element, unselects all parent elements. E.g. if Data package was
selected, all model is selected. Clearing checkbox next to Package View package will clears
all checkboxes next to inner Package View elements and next to Data package. Other
packages remain selected.
METRICS WINDOW
Metrics window is implemented as JIDE GUI window. It is placed at the bottom of
application, like the Messages window.
7-452
TO O L S
Metrics
GUI element
Desription
Expand Current
Branch
Collapse Current
Branch
Refresh
Metrics Options
Export
Compare Metrics
With
Open dialog box appears. Select text file to compare with currently
opened metric set.
Filter
Selected metrics rows or cells can be copied into clipboard. Selecting shortcut menu
command Copy or shortcut Ctrl+C copies the selected metric.
7-453
TO O L S
Metrics
Exporting metrics
Selected metrics rows and columns or entire metrics table may be exported to metrics results
file. Metrics results may be exported to *.txt and *.html formats.
MetricN
Package Package1
value
value
value
Value
value
value
value
Value
value
value
value
Value
Metric1
Metric2
Metric3
Metric
N
value
value
value
Value
value
value
value
value
Here Metric1 .. MetricN the metric name abbreviation. Each metric name is hyperlinked with
metric description. Metric description can be opened in a separate window after clicking on the
hyperlink.
NOTE:
*.html format is suitable for viewing metrics. If you want to copy metrics table to other
program, please use *.txt format.
7-454
TO O L S
Metrics
Element
Description
Metrics Output
File:
Path and file name of metrics results output file. The button
allows to select location and file.
Output Type:
Export selected
rows only
Comparing metrics
Counted metrics can be compared with metrics that are saved in *.txt file. Metrics may be
compared only when metrics window is opened.
Comparison results are displayed in the same metrics table. Metrics that have increased cell
are filled with red color; decreased metrics cells are filled with blue. Metrics that are not
found in other file cells are filled with grey color.
Metrics comparison can be canceled with Esc.
Metrics Options
Metrics suits are managed in the Metrics Options dialog box.
7-455
From the Tools menu, choose Metrics and then Metrics Options
TO O L S
Metrics
On the left side of dialog defined metrics suites are displayed. Metrics suites can be cloned,
renamed, removed, exported and imported using buttons or shortcut menu. Predefined
metrics sets cannot be renamed or removed. One the right side the suit properties are
displayed:
Element
Description
Metrics tree
Properties list
7-456
7-457
TO O L S
Metrics
Select All
Clear All
Reset to Default
Description
OK
TO O L S
Metrics
Metrics properties
Properties
Group
Property
Description
General
Calculate
Lowest limit
Package
Class
Diagram
Class
Diagram
7-458
TO O L S
Metrics
Properties
Group
Property
Description
Include
Weight
Example of metrics calculation for calculating number of classes (NC) for this tree:
Local
Global
Average
Min
Max
Top
Inner1
C1
C2
c_in1
c_in2
Inner2
C3
c_in3
c_in4
C4
7-459
TO O L S
Metrics
7-460
7-461
TO O L S
Metrics
TO O L S
Metrics
7-462
INDEX
A
abstract
class 185, 235
operation 197
Abstract (generalizable element) 140, 218
abstraction 227
action state 296, 299
defining arguments 301
defining entry action for 301
defining multiplicity 301
set as dynamic 301
actions 260
in state and activity diagrams 287
types of 263
activation bar 266, 271
active
class 185
object 264
activity diagram 294
incompatibilities between Rose and MagicDraw
108
incompatibilities between Together and MagicDraw 113
actor 231
working with 233
addOnly 192
aggregation 180
creating 223
argument
in action state 301
of action 264
of binding dependency 227
assigning
classifier to classifier role 252
classifier to collaboration 215
classifier to instance 247
instance to collaboration 215
model element to a package 145
model elements to component 321
state to object flow state 308
Assignment (action type) 263
association 179
in class diagram 218
in implementation diagram 316
B
balking message/stimulus 255
binding dependency 227
browser
changing position 87
changing size 87
closing or reopening 87
code engineering sets in 89
Containment tree 87
creating model elements and diagrams in 95
Diagrams tree 91
displaying full information in 88
Documentation tab 96
functions of 85
Inheritance tree 92
Model Extensions tree 93
multiple selections 96
sorting alphabetically 87
structure 85
Zoom tab 97
C
Call (action type) 263
464
465
D
data
creating several shapes of the same 127
Data package 44
data types 201
DDL diagram 374
decision point 298
deep history state 286
defining
model elements 133
deleting
all model elements 96
from the Browser 95
symbol or model element 129
dependency 226
abstraction 227
binding 227
in implementation diagram 317
permission 228
usage 229
deployment diagram 312
deployment view 176
design patterns 205
Destroy (action type) 263
destroying sequence object 271
diagram
closing 122
creating 120
defining properties of 58
information table 125
opening 121
renaming 122
saving as image 49
diagrams
activity 294
class 176
collaboration 242
content 359
CORBA IDL 371
DDL 374
implementation 312
model management 174
robustness 363
sequence 265
state 274
use case 230
web 365
WSDL 376
XML Schema 379, 382
display
related elements 127
E
editing
code engineering set 89
editions of MagicDraw 13
effect action 293
entry action 288, 299
defining for action state 301
enumeration 200, 203
enumeration literal 204
event 275, 288
exit action 288
exporting
project to XMI format 106, 111
stereotypes 325
tag definition 337
extend 232, 238
extension point 235
adding to use case 237
F
features of MagicDraw 13
final state 286, 302
frozen 192
G
generalizable elements 218
defining as 218
generalization
grouping into tree 217
generate
code from the selected set 90
getter 438
grid 163
size 164
snapping to 164
style 164
466
visibility of 164
grouping
diagrams in Browser 91
generalization paths into tree 217
of model elements 208, 210
realizations into tree 226
guard expression 293
Guarded 198
H
history state 286
HTML text 150
hyperlink 150
for model element 150
I
image
available formats 48
saving as 49
implementation diagram 312
elements in 314
incompatibilities between Rose and MagicDraw
109
incompatibilities between Together and MagicDraw 114
implicit event 299
include 232, 240
incompatibilities
between MagicDraw and Rose 107
between MagicDraw and Together 112
initial value
defining for attribute 247
showing on attribute 207
inner elements
of class (inserting) 185
installation
other platforms 22
system requirements 20
UNIX 22
using no install 22
Windows 21
instance 316
as scope 192
assign classifier to 247
assigning to collaboration 215
composite object 248
in collaboration diagram 244, 245
of association 248
of association end 248
of component 314
of node 315
instantiation 263
interface 315
interface style
making changes to 41
Metal 41
Motif 41
multiple windows 42
Windows 41
internal transition 283, 290
J
junction point 287
JVM (Java Virtual Machine)
for Mac OS X 21
for Solaris 21
for Windows 21
L
layout 153
Leaf
class 185
operation 197
Leaf (generalizable element) 140, 218
lifeline 266, 271
concurrent 267, 271
link 248
in class diagram 182
in collaboration diagram 244
in implementation diagram 316
link attribute 183
link end 248
link to self 244
logical view 175
Look and Feel themes 41
M
Mac OS X
installation 22
JVM 21
MagicDraw
appearance of 40
documentation 14
editions 13
environment options 24
features 13
support 17
updating 22
message 254
branching of 271
changing numbering of 258
defining action for 258
467
diagonal 267
in collaboration diagram 245
asynchronous 255
balking 255
synchronous 255
time-out 255
in sequence diagram 272
asynchronous 272
balking 272
call 273
create 273
destroy 274
return 273
send 273
synchronous 272
terminate 274
time-out 273
uninterpreted 274
predecessor of 259
recursive 267
to self 267
uninterpreted 267
model 213
development of 12
static structural 176
model element
defining 133
saving as image 49
model management 177
modules functionality 63
moving
of all model elements 96
symbol 132
MS Office
copying to 133
multiobject
creating 247
multiple windows 42
multiplicity
defining for classifier role 252
for dynamic action state 301
of an attribute 192
of association end 224
N
name
specifying for a shape 126
n-ary association 220
navigability
of association 224
node 314, 321
assigning components to 322
note 169
adding hyperlink to 150
retrieving documentation 171
text as HTML in 150
note anchor 169
numbering
changing 258
numbers
show/hide on collaboration diagram 258
O
object diagram 242
object flow state 305
assigning state 308
defining classifier for 308
opening
diagram 121
diagram from Browser 91
last project on startup 51
project 50
specification dialog box 133
operation
as query 198
concurrency 198
creating new 193
defining 193
defining as abstract, leaf, or root 197
for subsystem 212
functions of 193
parameter of 196
return type 197
return type of 195
scope of 198
show only public 207
showing signature of 207
visibility 198
operations
controlling the list of 185, 235
generation of setters and getters 185, 234
managing 439
sorting of 208
suppressing compartment 207
ordering
of attributes 208
of operations 208
P
package 178, 208, 315
adding inner elements 209
changing header position 210
Component View 44
468
Data 44
dependency wizard 410, 412
showing assigned model elements 210
parameter
of an operation 196
parameterized class 199
defining of 199
parent element 216
partition 309
partitioning 63
paste 132
with new data 132
path 120
changing style of 129
defining properties of 58
drawing 129
patterns See design patterns
permission 228
predecessor 259
presentation options
for class 206
primitive 205
printing 165
process view 176
programming language data type 205
project
dividing into modules 63
multiple projects 83
opening of 50
packages of 44
reusing project parts 63
properties
changing code generation 90
pseudostate 274, 286
Q
qualifier
of association end 225
R
realization 225
grouping into tree 226
in implementation diagram 317
recurrence 264
registering MagicDraw 22
relationship
displaying on diagram 129
renaming
diagram in Browser 92
reports 386
Return (action type) 263
return type
of an operation 197
reverse
changed files 90
code engineering set 90
robustness diagram 363
Root
class 185
operation 197
Root (generalizable element) 140, 218
Rose
exporting model to XML 104
importing model 105
XMI model exchange 104
S
Save (dialog box) 47
Save As Image (dialog box) 49, 50
saving 46
as image 49
formats 47
in .mdf format 46
project 47
project as template 48
scope
of operation 198
script 264
selection 131
all symbols of the same type 132
multiple 131
multiple (in the Browser) 96
of all model elements 96
of all symbols 132
of symbol 131
Send (action type) 263
separator 170
adding hyperlink to 150
sequence diagram
incompatibilities between Rose and MagicDraw
108
incompatibilities between Together and MagicDraw 113
model elements in 266
overview 265
Sequential 198
setter 438
shallow history state 286
shape
defining properties of 58
definition 120
drawing more than one shape 126
469
drawing of 126
shortcut keys
assigning 164
Signal (event type) 290
signal receipt 309
trigger event for 309
signal sending 298, 308
defining an action 308
smart manipulation 130
Solaris
JVM 21
sorting
of attributes 208
of operations 208
state 275, 278, 296
concurrent 282
internal 280
state diagram
incompatibilities between Rose and MagicDraw
108
incompatibilities between Together and MagicDraw 113
model elements in 275
state machine 274
statechart diagram See state diagram
stereotypes
Builds 331
Client Page 328
creating of 325
defining properties of 58
Form 328
Frame Context 331
Frame Set 329
IIOP 333
importing 325
Input Element 333
JavaScript 329
Link 329
Object 333
Page 334
Redirect 331
RMI 333
Select Element 333
Server Page 327
show/hide on a symbol 144
showing on class 208
Submit 331
Target 329
Targeted Link 331
Text Area 334
working with 323
stimulus 254
asynchronous 255
balking 255
changing numbering 258
changing numbering of 258
defining action for 258
main information about 245
synchronous 255
time-out 255
stub state 277
subactivity state 302
submachine state 282
substate 280
subsystem
adding operation to 212
description 210
realization elements 210
specification elements 210
support for MagicDraw 17
swimlane 309
symbols 120
defining properties 144
formatting 58
moving 132
presentation of
constraint 150
note 169
note anchor 150
separator 150
text box 150
synch state 285
defining bound number 285
synchronization bar
horizontal 277, 298
vertical 277, 298
synchronous 255
system boundary 231
T
tagged values
show/hide on a symbol 144
showing on class 208
working with 334
template
parameterized class See parameterized class
saving as 48
Terminate (action type) 263
text box 150
adding hyperlink 150
text as HTML in 150
text editor
choosing 90
Time (event type) 290
470
time-out 255
TODO 339
Together
exporting model to XML 110
importing model 110
XMI model exchange 109
transition 291, 297
differences in state and activity diagrams 292
effect action for 293
guard expression for 293
to self 277
trigger event for 293
trigger event
for a signal receipt 309
for a transition 293
type modifier 191
type of an attribute
showing full path 207
X
XMI 47
exporting project to 106, 111
XML Schema diagram 379, 382
Z
zooming 162
adjusting step size 163
fit in window 162
to maximum size 163
to original size 163
using Browser 97
zoom in 163
zoom out 163
U
Uninterpreted (action type) 263
Unix
installation 22
updating MagicDraw 22
usage 229
use case
adding extension point 237
description of 235
extension point 235
use case diagram 230
incompatibilities between Rose and MagicDraw
107
incompatibilities between Together and MagicDraw 112
use case view 175
V
visibility
for operation 198
of association end 224
showing on attribute 207
showing on operation 207
W
web diagram 365
web extension 327
Windows
interface style 41
JVM 21
wizards 386
workspace 45
471