Anda di halaman 1dari 462

USERS MANUAL

version 9.5

No Magic, Inc. April, 2005

CONTENTS

0
1-12

CONTENTS 2

1 INTRODUCING MAGICDRAW

MagicDraw Editions and Features 1-13

MagicDraw Personal edition 1-13 MagicDraw Standard edition 1-13 MagicDraw Professional editions 1-13 MagicDraw Enterprise edition 1-14 MagicDraw Reader Edition 1-14 MagicDraw Community Edition 1-14

MagicDraw Documentation and Support 1-14


Help 1-15 Users Guides 1-15 Other Documentation 1-16 Support 1-17 FAQ 1-17 Newsgroups 1-17 E-mail 1-17 Bug Reports 1-17

2 GETTING STARTED

2-20

Installing and Running 2-20

System requirements 2-20 Java Virtual Machine (JVM) 2-20 Operating system - dependent issues 2-21 Installation procedure 2-21 Windows 2000/9x/NT/XP 2-21 Unix 2-22 MAC OS X 2-22 All other platforms instructions (no install version) 2-22
Auto-Check for Updates dialog box 2-23

Updating 2-22

structure of menus and toolbars 2-23 Setting Personal Preferences 2-24


Environment Options 2-24 General pane 2-25 Diagram pane 2-28 Browser pane 2-29

MagicDraw User s Manual Contents

Teamwork pane 2-31 Floating pane 2-32 CVS pane 2-33 Update pane 2-34 HTTP Proxy pane 2-35 Keyboard pane 2-36 Plugins pane 2-37 Resources pane 2-38 Path Variables Pane 2-39 Launcher Pane 2-40 Look and Feel: Controlling Interface 2-40 JIDE and Multiple Windows interface styles 2-42

3 WORKING WITH PROJECTS


Creating New Project 3-44

3-44
3-45

Creating new project from already created template Importing project 3-46 Exporting project as template 3-47 Saving diagram as image 3-48 Autosave 3-50

Saving and Exporting 3-46

Loading 3-50 Project Options. Style Engine 3-51

Project Options 3-51 Symbols Properties Styles Tree 3-54 Working with Properties Styles 3-58 Properties extension by diagram 3-58 Properties Inheritance 3-59 General Style Properties 3-60 Shapes, Paths and Diagrams Properties 3-60 Stereotypes properties 3-61 Working with modules 3-63 Exporting Project Module 3-63 Using Project Module 3-65 Importing Project Module 3-65 Sharing packages 3-65 Opening Module As a Project 3-67 Reloading Module 3-67 Dependencies between elements 3-68 Packages dependencies by relationships 3-68 Dependencies by reference 3-71 Diagrams dependencies 3-71 Package Dependencies dialog box 3-72

Modules Functionality. Reusing project part - Partitioning 3-63

2004 No Magic, Inc.

MagicDraw Users ManuaI Contents

Profiles

Creating profiles 3-74 Using and importing profiles Exporting profiles 3-76

3-74

3-75

Model Differencing 3-76

Models comparison 3-77 Understanding model differences 3-78 Diagrams Comparison 3-81

Working with multiple projects Using Browser 3-84

3-83

The Browser window parts 3-85 Containment tree 3-87 Data branch 3-89 Code engineering sets 3-89 Diagrams tree 3-91 Inheritance tree 3-92 Model Extensions Tree 3-93 Search Results Tree 3-94 Working with model elements in the Browser tree Multiple selection 3-96 Documentation/Zoom Control/Properties 3-96 Documentation tab 3-96 Zoom Control tab 3-97 Properties tab 3-98

3-95

Searching 3-99

Java Regular Expressions 3-101 Metacharacters 3-101 Character Sets 3-102 Grouping 3-102 Quantifiers 3-102 Boundary Matchers 3-103 Embedded Flag Expressions 3-103 Rational Rose 3-104 MagicDraw 3-106 Metamodel and XMI incompatibilities 3-107 Other noticed incompatibilities 3-109 Together ControlCenter 3-110 MagicDraw 3-111 Metamodel and Unisys XMI incompatibilities Other noticed incompatibilities 3-114

MagicDraw and Rational Rose

3-104

MagicDraw and Together ControlCenter

3-109

3-112

Resources Manager

3-114

2004 No Magic, Inc.

MagicDraw User s Manual Contents

4 DIAGRAMS BASICS

4-120

Working with Diagrams 4-120

Diagrams dialog box 4-122 Diagram Properties 4-124 Table with diagram information 4-125

Drawing Shapes 4-126 Drawing Relationship paths 4-129 Smart Manipulation 4-130 Selection. Multiple Selection 4-131 Dragging, Copying, Cutting, and Pasting 4-132 Specifying Model Elements 4-133

Specification dialog boxes 4-133 Relations tab 4-134 Stereotypes tab 4-135 Tagged Values tab 4-136 Constraints tab 4-138 General tab 4-139 Attributes tab 4-141 Operations tab 4-142 Hyperlinks tab 4-143 Buttons available in the Specification dialog boxes 4-144 Formating Symbols 4-144 Owner of the model element 4-145 Usages functionality 4-146 Dependent Elements functionality 4-146 Find Usages / Dependent Elements Options dialog box 4-147 Elements Using \ Dependencies windows 4-148 Defining Hyperlinks 4-150 Insert Hyperlink dialog box 4-151 Orthogonal Layouter 4-154 Hierarchic Layouter 4-154 Tree Layouter 4-156 Organic Layouter 4-158 Circular Layouter 4-159 Orthogonal Path Router 4-160 Organic Path Router 4-160 Class Diagram Layouter 4-161 Quick Diagram Layout feature 4-162

Model Traceability 4-146

Laying out

4-153

Zooming 4-162 Using Grid 4-163 Assigning Shortcut Keys 4-164 Printing 4-165
Print Range tab

4-165

2004 No Magic, Inc.

MagicDraw Users ManuaI Contents

Print Options Tab 4-167 Print Header/Footer Tab 4-168

Model Elements Common in all Diagrams 4-169


Note Anchor 4-169 Constraint path 4-170 Separator 4-170 Documentation 4-170

5 UML DIAGRAMS
System Views

5-174

Use Case View 5-175 Logical View 5-175 Process view 5-176 Component view 5-176 Deployment view 5-176 Class diagram elements 5-178 Classes 5-183 Working with classes 5-183 Interface 5-186 Attribute 5-188 Operation 5-193 Template / Parameterized class 5-199 Port 5-200 Data types 5-201 Enumeration 5-203 Primitive 5-205 Programming Language Data Type 5-205 Design Patterns 5-205 Class presentation options 5-206 Packages 5-208 Working with packages 5-208 Subsystem 5-210 Model 5-213 Collaboration 5-214 Generalization 5-216 Generalizable elements 5-218 Association 5-218 Association End 5-220 Realization 5-225 Dependency 5-226 Abstraction 5-227 Binding dependency 5-227 Permission 5-228

5-175

Class Diagram 5-176

2004 No Magic, Inc.

MagicDraw User s Manual Contents

Usage 5-229 Merge 5-229 Import 5-229 Containment 5-230

Use Case Diagram

Use Case diagram elements 5-231 Actors 5-233 Working with actors 5-233 Use Cases 5-235 Use Case Extensions 5-237 Relationships in Use Case diagram 5-238 Association 5-238 Extend 5-238 Include 5-240 Generalization 5-241 Dependency 5-241 Realization 5-241 Containment 5-241 Instance level 5-242 Specification level 5-242 Collaboration Diagram elements 5-244 Instance 5-245 Instances Specification dialog boxes 5-245 Link 5-248 Classifier role 5-251 Association role 5-252 Stimulus / Message 5-254 Predecessors and activators 5-259 Actions 5-260 Action types 5-263 Active objects 5-264 Sequence diagram elements 5-266 Interaction Use 5-268 Combined Fragment 5-269 Lifelines 5-271 Messages in sequence diagram 5-272 State Diagram elements 5-275 State 5-278 Concurrent state 5-282 Submachine 5-282 Synch state 5-285 PseudoStates 5-286

5-230

Collaboration Diagram

5-242

Sequence Diagram

5-265

State Diagram 5-274

2004 No Magic, Inc.

MagicDraw Users ManuaI Contents

Initial state 5-286 Final state 5-286 History state 5-286 Junction and dynamic choice points 5-287 Actions in State and Activity diagrams 5-287 Action labels 5-288 Events 5-288 Event types 5-290 Internal transitions 5-290 Transition 5-291 Guard Specification dialog box 5-293

Activity Diagram 5-294

Activity Diagram elements 5-296 Action state 5-299 Call State 5-302 Subactivity state 5-302 Flow Final 5-304 Decision Point 5-305 Object flow state 5-305 Signal sending / receipt shapes 5-308 Signal sending 5-308 Signal receipt 5-309 Swimlanes 5-309 Component diagram overview 5-312 Deployment diagram overview 5-312 Implementation Diagram elements 5-314 Components 5-318 Nodes 5-321 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

Implementation Diagrams 5-312

UML Extension Mechanisms

5-323

2004 No Magic, Inc.

MagicDraw User s Manual Contents

6 EXTENSION DIAGRAMS
Content Diagram 6-359 Robustness Diagram

6-358
6-360 6-364

Content Diagram Elements Robstness Diagram Elements Web Diagram Elements

6-363

Web Diagram 6-365 CORBA IDL Diagram

6-367 6-372

CORBA IDL Diagram Elements DDL Diagram Elements WSDL Diagram Elements 6-375

6-371

DDL Diagram 6-374

WSDL Diagram 6-376

6-377 6-380

XML Schema Diagram 6-379 Time Diagram


Time Diagram Elements

XML Schema Diagram Elements

6-382

6-383

7 TOOLS
Reports

7-386
7-386

Template Management tab 7-387 Document Options 7-391 Model Report 7-392 Use Case Report 7-394 Software design Description 7-395 Model Extension Report 7-397 Select Packages tab 7-398 Select Diagrams tab 7-399 Output Options tab 7-400 Report Customization 7-401 New report style creation example 7-402 Fonts in PDF and PS reports 7-404 Report Generator Tool 7-404 Starting report generator 7-404 Generating Configuration file 7-404

Class Diagram Wizard 7-405 Package Dependency Wizard 7-410 Package Overview Diagram Wizard 7-412 Tools for Analysis 7-417
Hierarchy Diagram Wizard 7-418 Realization Diagram Wizard 7-421

Content Diagram Wizard 7-426 Sequence Diagram from Java Source Wizard 7-428 Pattern Wizard 7-432 Creating Setters / Getters 7-438

2004 No Magic, Inc.

MagicDraw Users ManuaI Contents

Implementing or Overriding Operations 7-439 Model Transformation Wizard 7-440

Types of the transformations 7-440 Model Transformation Wizard 7-441 Model Transformation Mapping 7-444 Transformation Mapping Possibilities 7-445 Model Transformation Update 7-448

Metrics 7-449

Metrics suites 7-449 Displaying metrics 7-450 Invoking Metrics 7-451 Metrics window 7-452 Exporting metrics 7-454 Comparing metrics 7-455 Metrics Options 7-455 Metrics properties 7-458

INDEX 464

2004 No Magic, Inc.

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.

2005 No Magic, Inc.

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.

MAGICDRAW EDITIONS AND FEATURES


The detailed list of MagicDraw features find at: http://www.magicdraw.com/files/brochures/a4/MagicDrawDataSheet.pdf MAGICDRAW PERSONAL EDITION The MagicDraw Personal Edition contains all of MagicDraw's powerful UML diagramming capabilities, including full UML 1.4 support and extensibility features, basic reporting functionality and image export. Files are stored in XMI format. All model elements can be accessed via MagicDraw's Open API. In this edition, you will find everything you need to draw, edit and publish your UML models. MagicDraw Personal Edition is available only in a standalone version and is not designed for use with the MagicDraw Teamwork Server. MAGICDRAW STANDARD EDITION The Standard Edition takes all of the Personal Edition's features and adds to them a WAE, content, and Robustness diagrams, model analysis and facilitation features, customizable and extendable patterns, integrations with most popular IDEs and a set of predefined model templates and UML profiles. The Standard Edition also supports UNISYS XMI diagramming extensions for interchanging the MagicDraw models you create with other UML modeling tools as well as the latest Model Driven Architecture (MDA) tool offerings. The Standard Edition is available in standalone, floating and mobile license versions and is fully compatible with the MagicDraw Teamwork Server. The Standard Edition is ideally suited for all analysts and architects who need various model extensions and modeling facilitations. MAGICDRAW PROFESSIONAL EDITIONS The Professional Edition is built on the Standard Edition's capabilities and is available in one of three programming language specific versions-Java, C++ and C#. In addition to the Standard Edition's features, the Professional Edition adds code generation and reverse engineering functionality. Depending on the language version selected, the user will receive:

Java version - Code engineering for Java, Java bytecode. Integration with Java IDEs.

1-13

2005 No Magic, Inc.

INTRODUCING MAGICDRAW MagicDraw Documentation and Support

C++ version - Code engineering for C++. C# version - Code engineering for C#, CIL (MSIL).

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.

MAGICDRAW DOCUMENTATION AND SUPPORT


MagicDraw provides several kinds of documentation. Choose the way you want to know how to use MagicDraw. The main information about MagicDraw, you may find at www.magicdraw.com.

2005 No Magic, Inc

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 MagicDraw UserManual.pdf

Description Includes detailed explanations and instructions of installing and working with MagicDraw.

Location

<MagicDraw installation directory>/manual Start/Programs/MagicDraw UML/MagicDraw User Manual.pdf www.magicdraw.com -> Download->Download Manual

1-15

2005 No Magic, Inc.

INTRODUCING MAGICDRAW MagicDraw Documentation and Support

Name MagicDraw CodeEngineering UserGuide.pdf

Description In this user guide you will find not only basic information about reverse and generation in MagicDraw but also detailed descriptions about DDL, CORBA IDL, EJB 2.0, and XML Schema usage in MagicDraw. Step by step instructions presenting the basics of using MagicDraw diagramming, creation of sequence diagram, integration with CVS and Eclipse. You will find here the full description of how to integrate MagicDraw with Eclipse, Borland JBuilder, Sun One Studio (before called Forte) including Netbeans, and CVS. Here you will find how setup and how to use MagicDraw Floating License server. In this document, you will find information how to install, set up, and use Teamwork Server and Teamwork Server Administrator. Also included detailed descriptions of how to work with the teamwork projects.

Location

<MagicDraw installation directory>/manual www.magicdraw.com -> Download->Download Manual

MagicDraw Tutorials UserGuide.pdf

MagicDraw Integrations UserGuide.pdf

MagicDraw FloatingLicense UserGuide.pdf MagicDraw Teamwork UserGuide.pdf

MagicDraw OpenAPI UserGuide.pdf

ins, create actions in the menus and toolbars, change UML foundation elements, and

This document describes MagicDraw Open Java API and provides instructions how to write your own plug-

<MagicDraw installation directory>/openapi/docs

create new patterns.

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.

2005 No Magic, Inc

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). Version distribution (Standard/Professional, Windows/Java bytecode). Your OS name and version. JDK version, JVM vendor. 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

2005 No Magic, Inc.

GETTING STARTED

INSTALLING AND RUNNING

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 CPU Memory Minimum Pentium III 500 256 MB Recommended Pentium 4 1600 512MB; 1GB is recommended for larger projects 200 MB or more 1280*1024 @ 64k Colors

Disk space Video mode Operation system

200 MB 800*600 @ 64k Colors

All that have Java compatible JVM 1.4: Windows 95/98/NT/2000/XP , Linux, Mac OS X (most testing procedures and debugging were performed on those platforms) Any JDK 1.4 Netscape Navigator or IE Suns JDK 1.4.2_03

HTML browser Java Virtual Machine (JVM)

Java Virtual Machine (JVM)


You may have the JVM installed on your computer or install JVM together with MagicDraw specifically for MagicDraw application. JVM is an application that provides the interpretation of the bytecode Java class files. Different operating systems may have different JVM implementations, thus some bugs may be specific to the operating system or JVM. MagicDraw is a stable environment, if it is configured properly and if the stable JVM is used. USE RECOMMENDED JVM TO AVOID A LOT OF PROBLEMS. All recommendations are written below. As MagicDraw is a Java application, most of the stability and performance depends on the JVM implementation. Refer to the JVM specification and problems' description, if you have problems on the specific OS.

2005 No Magic, Inc.

2-20

GETTING STARTED Installing and Running

JDK 1.1.x, 1.2.x, and 1.3.x is not supported. You can review your system and JVM information in the About dialog box, Info tab (from the Help menu, choose About). JDK version also can be encountered from command line by writing:
java -version

To change Java version


Change line in file mduml.properties (this file is in bin folder): JAVA_HOME = <path to new JDK> OPERATING SYSTEM - DEPENDENT ISSUES Because MagicDraw is 100% Pure Java, it is platform independent and runs on a variety of operating systems. However, for Java applications to interact properly with the operating system, Java Virtual Machine (JVM) software is required. JVM software varies depending on the operating system, and MagicDraw may perform inadequately with the wrong one. The performance of Java applications depends on the performance of the Java Virtual Machine. A badly designed Machine may degrade the performance of MagicDraw. It could even cause MagicDraw to fail or crash. To avoid these problems, we recommend that you use the following Virtual Machines:

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. MagicDraw runs only on Mac OS X operating system. We recommend to use JDK 1.4.x. MagicDraw has some problems on default Mac OS X JDK (JDK1.3).

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

2005 No Magic, Inc.

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:

Launch mduml.exe in bin directory to start MagicDraw. Launch ./mduml in bin directory to start MagicDraw.

On Unix or Mac OS X platform:

Be sure you have JVM installed.

UPDATING
Automatic updates feature is implemented in MagicDraw. Notification and update of all the patches can be done automatically.

To enable an automatic checking for MagicDraw updates


1 Open the Environment Options dialog box, Update pane. For a detailed

NOTE

description of this dialog box, see Section Setting Personal Preferences on page 2-24. 2 Choose a period when MagicDraw checks for updates from the Check for Updates drop-down list box: Manually, On startup, Once a day, Once a week, Once a month. It is recommended to check for updates once a month. You may also manually check for updates: go to the Help menu and choose the Check for Updates command.

2005 No Magic, Inc

2-22

GETTING STARTED structure of menus and toolbars

AUTO-CHECK FOR UPDATES DIALOG BOX The dialog box is opened, when automatic checking for MagicDraw UML updates is enabled on the Update pane in the Environment Options dialog box and the Show AutoChecking Confirmation Dialog Box check box is selected.
Element Name Show this tip next time Function If selected, the dialog box is opened each time, when the MagicDraw should be updated according to the schedule selected on the Update pane in the Environment Options dialog box. Starts checking for MagicDraw UML updates in the http://www.magicdraw.com page. Closes the dialog box without saving changes. Displays MagicDraw Help.

Check Cancel Help

STRUCTURE OF MENUS AND TOOLBARS


Before starting working with MagicDraw, keep in mind how MagicDraw is organized. Not all information will be described, as nearly all commands are accessible in various ways, that are listed in the table below.
Function Main operations of editing (copy, cut, paste, delete) Opening of Specification dialog boxes Accessibility

Edit menu. Main toolbar buttons. Shortcut keys. Shortcut menu commands from Browser. By double-clicking the model element. Specification command from the element shortcut menu on the diagram or Browser. When adding one model element to another model element from the Specification dialog box or Browser. Symbol shortcut menu -> Symbol(s) Properties. Options menu -> Project. Main toolbar buttons

Defining symbols properties (font, color, etc.) NOTES

Symbol shortcut menu is also accessible from Edit menu, Symbol. The toolbar of the particular diagram presents the paths and shapes available for the corresponding diagram. If an arrow is placed on the diagram toolbar button, select a button representing the corresponding model element by rightclicking the button.

2-23

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

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.

To open the Environment Options dialog box


Choose Environment from the Options menu.

Buttons available in the Environment Options dialog box


Reset to Defaults OK Cancel Help Resets all properties to the default ones. Saves changes and exits the dialog box. Exits the dialog box without saving changes. Displays MagicDraw Help.

2005 No Magic, Inc

2-24

GETTING STARTED Setting Personal Preferences

GENERAL

PANE

Figure 1 -- Environment options dialog box. General pane

Change the appropriate fields according to your preferences. If the check box is selected, the description False changes into True.
Property name Create backup file Diagrams load mode Function Back up files of your projects will be created. Backups are saved with name pattern old_name.xml.bak or old_name.xml.zip.bak. Choose how to load diagrams after opening MagicDraw project. 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.

2-25

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

Property name EMF character set Help font Help server port Icon size Idle time to activate recovery save Language

Function Choose the encoding standard for the characters that will be copied to EMF. Choose the font that will be used in Help window. The default Help server port is 1111. Change it, if some other server is started on this port. 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. Choose the language you wish the MagicDraw GUI to be displayed: Default according to your application. It is set by default. English French German Italian Japanese Korean Portuguese Brazil Spanish Thai NOTE Restart MagicDraw to apply the changed language. Shows active hyperlink arrow on element symbol. The project you have finished the last session will be opened next time you start MagicDraw UML. Type the number of the projects to appear on the File menu. Click the file name to open it. The maximum files list size is 10. The file name list shows files that were used in 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. Saves the diagram background in the image together with the saved as image diagram. By default the diagram background, after saving as image, is white. Saves AutoRecovery file of the opened project(s) when a system is not in use. Saves maximum additional information to xmi file, which is not required on Magic Draw load but may be needful using other tools. The changed settings within current MagicDraw session will be restored in the later sessions.

Mark elements with active hyperlink Open last project on startup Recent files list size

Recent windows list size

Save diagram background in image Save project recovery data on idle Save rich XMI

Save settings on exit

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.

2005 No Magic, Inc

2-26

GETTING STARTED Setting Personal Preferences

Property name Show hyperlinks in specification dialog Show memory monitor Show model enrichment suggestion dialog Show status bar Show tip of the day Undo list size

Function Shows the Hyperlinks tab in the element Specification dialog box. Shows the project memory usage line in the bottom of the Magic Draw window. Opens the Model Enrichment dialog box in report generation. 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. Type the number of actions that will be available for undo/redo operations. They will be listed in undo/redo drop down lists on the main toolbar. The maximum undo/redo list size is 500. Icons on the button of dialog boxes are shown. If selected, displays the list of available classifiers, if not selected, the hierarchy of all model elements is displayed in a drop-down list for selecting a type. Opens the Software Design Model Wizard or Use Case Model Wizard in report generation.

Use icons in dialogs Use list for type select

Use model enrichment wizard

2-27

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

DIAGRAM

PANE

Figure 2 -- Environment Options dialog box. Diagram pane

Property name Allow class members selection Apply stereotype style for all symbols

Function Operations and attributes can be selected and dragged & dropped to the other class. Applies created stereotype style to symbol when adding stereotype to element.

Apply stereotype style Applies stereotype style in teamwork for unlocked diagrams. for symbols in unlocked diagrams Center on the mouse Centers zooming according to mouse arrow. location when zooming Display paths on element drop Edit name with stereotypes Graphics antialiasing Grid style When dragging and dropping an element from the Browser or executing a Create Symbol action, path to existing symbols are created. Allows to manage stereotypes by editing stereotype name directly on the Diagram pane Smooths the jagged edges of graphics. Select one of the following style of the grid: Dense and Sparse.

2005 No Magic, Inc

2-28

GETTING STARTED Setting Personal Preferences

Property name Mark selected labels Optimize paths Show manipulation highlighting

Function Mark paths labels after selecting a path. When a path is drawn in various directions, this selected option removes loops from the path. Enable error highlighting of the modeling process. This helps you to see the errors in the model at the drawing time. The valid and invalid actions will be highlighted in different colors (defaults are red for invalid actions, blue for valid actions). Smooths the jagged edges of text.

Text antialiasing

Use smart manipulation Easy you work of working with symbols. For the detailed description about smart manipulation feature, see Section Smart Manipulation on page 4 -130. Zoom step size Type in the step value of zooming your diagram views. Step value should be in range from 0.1 to 1.0.

BROWSER

PANE

Figure 3 -- Environment Options dialog box. Browser pane

Property name

Function

2-29

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

Property name Browser position

Function 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 Groups diagrams according to diagram type in the Diagrams tree. Groups stereotypes, tagged values and constraints by profiles in the in the Model Extensions Tree. Highlight edited or added model elements and diagrams in the Browser. Shows code engineering sets items in the browser.

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 Shows the full attributes, operations, and relationships data. Shows hyperlinks that are assigned to the model elements. Shows stereotypes that are assigned to the model elements. Always alphabetically sort browser items.

2005 No Magic, Inc

2-30

GETTING STARTED Setting Personal Preferences

TEAMWORK

PANE

Figure 4 -- Environment Options dialog box. Teamwork pane

Property name Auto login to server Teamwork server name Show commit warning Show modules versions conflict warning

Function The user automatically logs on to the Teamwork Server after starting MagicDraw. Shows the name of your teamwork server. The warning appears while committing project to the Teamwork Server. The warning appears when two modules (or module and a project) use the same submodules.

2-31

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

FLOATING PANE This pane is available only if you use MagicDraw Floating License.

Figure 5 -- Environment Options dialog box. Floating pane

Property name Floating license server name Floating license server port Auto login to floating license server

Function Specify the name of the Floating License Server. Enter the port number of the Floating License Server. The server may be started on many different ports. If selected, automatically logs in to the Floating License Server when starting MagicDraw.

2005 No Magic, Inc

2-32

GETTING STARTED Setting Personal Preferences

CVS

PANE

Figure 6 -- Environment Options dialog box. CVS pane

Property name Add project to CVS after saving Commit project to CVS after saving Update project from CVS before loading Location of .cvspass Local folder

Function Every time adds a newly created project in the checked out directory to CVS. The Add Project to CVS dialog box appears. Updates the project that is added to CVS while loading. The Update CVS Project dialog box appears. Commits project to CVS after saving it. The Commit Project to CVS dialog box appears. The path where the .cvspass is located. You may type it or choose the path from the Open dialog box. The path where the module will be saved on checkout action. You may type it or choose the path from the Open dialog box.

2-33

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

UPDATE

PANE

Figure 7 -- Environment Options dialog box. Update pane

Property name Check for Updates

Function Choose the period for checking MagicDraw updates. Manually On startup Once a day Once a week Once a month (recommended) If selected, shows the confirmation dialog each time before autochecking.

Show auto-checking confirmation dialog box

2005 No Magic, Inc

2-34

GETTING STARTED Setting Personal Preferences

HTTP PROXY

PANE

Figure 8 -- Environment Options dialog box. HTTP Proxy pane

Property name Use HTTP proxy server HTTP proxy server address HTTP proxy server port HTTP proxy server user Authenticate HTTP proxy server

Function If selected, uses the Http Proxy Server when MagicDraw is checking for updates. Type the Http Proxy Server name or IP address. Type the port of the HTTP Proxy Server. The default number is 8080. Type the name of the Http Proxy Server user. Authenticates Http Proxy Server.

2-35

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

KEYBOARD

PANE

Figure 9 -- Environment Options dialog box. Keyboard pane

Property name Category

Function 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. The list of commands from the selected category. If All Categories is selected in the Categories list, all commands of an application are shown in this list. Commands are alphabetically sorted. The selecting of the command shows already assigned shortcut keys in the Current keys list. The list of keys assigned to the selected command. 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. 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. Assigns the entered key to the selected command. The entered key is added to the Current Keys list.

Commands

Current keys Press new shortcut key

Currently assigned to Assign

2005 No Magic, Inc

2-36

GETTING STARTED Setting Personal Preferences

Property name Remove Remove All

Function Removes the selected keys from the selected command. Removes all keys from the selected command.

PLUGINS

PANE

Figure 10 -- Environment Options dialog box. Plugins pane

Property name Name Provider Version Loaded Enabled Disable/Enable

Function The name of the plugin. The name of the company which provides a plugin. Version number of the selected plugin. Indicates if the plugin is correctly loaded. Shows the status of the plugin. If True, the selected plugin is activated in MagicDraw. Disables or enables the selected plugin.

2-37

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

RESOURCES PANE Displays the external resources such as dtd, xsd, etc. that are used in MagicDraw.

Figure 11 -- Environment Options dialog box. Resources pane

Property name

Function

Configure External Resources. Define external resources that will be used in XML parsing. Location URI Edit Add Remove URI Edit The location of the external resource. The URI of the external resource. Edit the location and the URI of the resource in the External Resource dialog box. Add a new external resource Remove the selected resource form the list. The URI of the external resource that will not ignored in MagicDraw. Edit the URI of the ignored external resource in the External Resource dialog box.

Configure Ignored Resources

2005 No Magic, Inc

2-38

GETTING STARTED Setting Personal Preferences

Property name Add Remove

Function Add a new external resource that will be ignored. Remove the selected ignored resource from the list.

PATH VARIABLES PANE

2-39

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

LAUNCHER PANE

Figure 12 -- Environment Options dialog box. Launcher pane

Property name Default Launcher Default Browser Defined Launchers Edit Add Remove Reset to Defaults OK Cancel Help

Function The Launcher Properties dialog box appears. The Launcher Properties dialog box appears. Opens the Launcher Properties dialog box for editing launcher information. Adds launcher in the Launcher Properties dialog box. Removes launcher from the list. Resets all properties to the default ones. Saves changes and exits the dialog box. Exits the dialog box without saving changes. Displays MagicDraw 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.

2005 No Magic, Inc

2-40

GETTING STARTED Setting Personal Preferences

To make changes to the interface:


From the Options menu, choose Look and Feel and then choose the style you wish.

Figure 13 -- Look and Feel Themes submenu

Theme Metal CDE/Motif Windows Kunststoff

Description Standard Java Swing library (default) Similar to GUI that is used on UNIX operating systems Microsoft Windows 95, Windows NT 4.0, Windows 2000 interface Is an extension of the Java Metal Look and Feel. MagicDraw will have a more modern and smoother look.

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:

Aqua Contrast Big Contrast Green MagicDraw Big MagicDraw

2-41

2005 No Magic, Inc.

GETTING STARTED Setting Personal Preferences

Khaki Kunststoff Theme Custom set your own options in the Properties dialog box.

JIDE AND MULTIPLE WINDOWS INTERFACE STYLES Since MagicDraw version 7.5, modern JIDE library is implemented. Using the JIDE interface style, it is possible to work with Browser window in more flexible way, use documentation, zoom, and message windows as dockable and place above the main window. Now you may arrange the Browser window in your desired combination, hide the desired Browser windows Also you may use Multiple Windows style. It allows you to manage all windows independently, as if they belong to different applications. For instance, you may overlap the tools windows across each other, resize them independently and so on. There is no main window where all other windows are placed.

To set interface style


From the Options menu, choose Interface Style, and then choose one of the desired interface styles: Multiple Windows, or JIDE.

2-42

2005 No Magic, Inc.

WORKING WITH PROJECTS

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

CREATING NEW PROJECT


All project information is stored in a single file. A project name matches the file name where the project is saved. The newly created project consists of the following packages:

Data package is empty and holds all model elements. 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

2005 No Magic, Inc.

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.

To create a new workspace for a project


From the File menu, choose New Project. On the main toolbar, click the New Project button. Press shortcut key CTRL+N.

In all cases, you receive a new project named UntitledN, and it is selected as an active project.

Creating new project from already created template


C++, CIL, Java, C#, DDL, EJB, WSDL, XML Schema, MOF , RUP extensions, CORBA IDL, and UMLWebExtension templates are available in the New From Template dialog box. The New From Template command is used for creating a new project from the selected template file.

3-45

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Saving and Exporting

To open the New From Template dialog box


From the File menu, choose New From Template.

Figure 14 -- New From Template dialog box

The newly created project from template will contain specific model elements and stereotypes.
TIP!

All MagicDraw templates are located in the <MagicDraw installation directory>/templates folder so you may import the desired template in your already created project using Import command from the File menu.

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.

SAVING AND EXPORTING


IMPORTANT! Beginning with MagicDraw version 3.6, the native MagicDraw format is .xml.

Saving in .mdf format is not allowed.

2005 No Magic, Inc

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.

To save the project


1 From the File menu, choose the Save Project or Save Project As command, or

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.

Figure 15 -- Save dialog box

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.

Exporting project as template


You may save (export) the created project as a template and use the same project for creating other new projects.
2005 No Magic, Inc.

3-47

WO R K I N G W I T H P R O J E C T S Saving and Exporting

To export project as template


1 Open a project you want to export as a template. From the File menu, choose

Export, and then Template. 2 The Export Template dialog box appears. 3 Type the name and a description of a template. 4 Click OK.

Figure 16 -- Export Template dialog box

Box Template Name Description OK Cancel Help

Function Type a template name. Type information about the template. Exports the template and the description to the Templates folder. Closes the dialog box without exporting the template. Displays MagicDraw Help

Saving diagram as image


Diagrams that were created in the model can be saved as image in the following formats:

Enhanced Metafile Format (*.emf) - supports language specific symbols. Encapsulated PostScript (*.eps) Joint Photographic Experts Group (*.jpg, *.jpeg) Portable Network Graphics (*.png) Scalable Vector Graphics (*.svg)

2005 No Magic, Inc

3-48

WO R K I N G W I T H P R O J E C T S Saving and Exporting

Windows Metafile Format (*.wmf)

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.

To save the selected diagrams of your project as images


1 Choose the Save Selected Diagrams As Images command from the File menu.

The Save As Image dialog box appears. 2 Choose diagrams you want to save as image from the Not Empty Diagrams list. 3 In the Working Directory field, type in the name of the destination directory, or click the ... button to, browse the directory list. 4 Select the graphical file format in the File Format drop down list (JPG, PNG, WMF, EPS, EMF, or SVG) and click Save.

Figure 17 -- Save As Image dialog box

The filename of the saved diagram will be the same as the name of that diagram.

3-49

2005 No Magic, Inc.

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 make multiple selections


Press the CTRL key and click the diagrams you wish to export.

To select or unselect all diagrams


Click the Select All button (press CTRL+A keys) or Unselect All button.

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.

Saved projects can be loaded back to MagicDraw.

To edit or review already created projects


1 From the File menu, choose Open Project, or click the Open Project button on

TIP: NOTES:

the main toolbar. 2 In the Open dialog box, choose the project you wish to open and click Open. Drag and drop the project you wish to open directly from the open window to the MagicDraw. The project is started at once.

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.

PROJECT OPTIONS. STYLE ENGINE


Style engine is a part of the MagicDraw UML system that defines diagrams, shapes, paths, and stereotypes properties. There may be few properties styles defined but all symbols are created according to the style that is selected as default. There is possibility to apply different presentation styles for diagram/shape/path/stereotype depending on diagram type.

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

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Project Options. Style Engine

To change the default project options and Code Engineering tasks


From the Options main menu, choose Project. The Project Options dialog box appears.

Figure 18 -- Project Options dialog box

The Project Options dialog box has several collections of customizable options:
General Project Options Define the default packages where the extension elements will be stored. Also if desired you may choose the package every time when creating a new extension element, the dialog box asking about the storage place will appear. In the Modules Path text box, enter the path where by default modules will be stored. Customize what and how information will be displayed in the Diagram Info table. Expands tree hierarchy of all the styles defined within the project. You may create as many of these styles as you like. NOTE To apply the changed project option to the opened project, click the Apply button. Define general code engineering options as well as options specific to languages. The description about this part, see Code Engineering users guide.

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

2005 No Magic, Inc

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 Clone Rename Delete Make Default Apply Import Export Reset to Defaults Function Clone (duplicate) the selected style. Change the name of all existing style. Type a new name for a style in the Enter Style Name dialog box. Remove the selected style. Make the selected style as your default style for the newly created projects. Apply the selected style to the opened project. The Open dialog box appears. Select the style you wish to import (*.stl). The Save dialog box appears. Select the directory where you wish to export a style. Changes all settings to the default configuration.

To create a new style by cloning the existing one


1 Select the default style in the Styles list box and click the Clone button. 2 Type the name for the new style in the Enter Style Name dialog box. 3 Change options of the new style.

To change the name of the selected style


1 Select a style you want to rename and click the Rename button. 2 Type a new name for the style in the Enter Style Name dialog box.

To remove the selected style


Click the Delete button in the Project Options dialog box.

To make a selected style your default style for newly created projects
Click the Make Default button in the Project Options dialog box.

To apply the selected style or changed option to a current project

Click the Apply button in the Project Options dialog box, Styles pane.

NOTE:

You may also apply the desired options to the selected diagrams model elements. Click the Apply button in the specific elements pane.

3-53

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Project Options. Style Engine

To import an already created (and exported) project style


Click the Import button. The Open dialog box appears. Select the style you wish to import (*.stl).

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.

2005 No Magic, Inc

3-54

WO R K I N G W I T H P R O J E C T S Project Options. Style Engine

Figure 19 -- Project Options dialog box. Styles

In the following table you may find all possible options that can be set for the symbols:
Property Fill Color Use Fill Color Pen Color Text Color Font Autosize Use Fixed Connection Points Path Style Attribute Color Attribute Font Attributes Sort Mode Constraint Text Mode Direction Header Position Header in Bold HTML Text Line Style Operation Color Operation Font Operations Sort Mode Function (when selected) The fill color of the symbol. The Color dialog box appears. Uses the fill color and symbols are colored on the diagram. The pen color that is used to draw elements. The Color dialog box appears. The color that is used for text coloring. The Color dialog box appears. Font that is used for a name and other displayed properties of the model element. The Font dialog box appears. Adjusts the size of a symbol to the contained information. Element borders are changed so that it uses minimum space. The end of the path is connected to the fixed point of the shape. The drawing style of a path. Possible choices: Rectilinear, Oblique, or Bezier. The color of the attribute name. The Color dialog box appears. Font that is used for a name of the attribute. The Font dialog box appears. The mode for sorting attributes. Possible choices: No Sorting, By Name, By Stereotype, or By Visibility. Displays constraints name or expression on a symbol. The direction of a signal. Possible choices: Right or Left. The package name position on the symbol. Possible choices: Top or In Tab. Shows the name of the symbol as bolded. Activates HTML editor for the text of a note and a text box. A line style for a horizontal separator. Possible choices: Dashed or Solid. The color of the operation name. The Color dialog box appears. Font that is used for a name of the operation. The Font dialog box appears. The mode for sorting operations. Possible choices: No Sorting, By Name, By Stereotype, or By Visibility. Primarily the sychronization bar diagram button is set to vertical or horizontal position. Shows constraints of attributes. Shows tagged values of an attribute. Shows stereotypes of attributes.

Orientation Show Attributes Constraints Show Attributes Properties Show Attributes Stereotypes

3-55

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Project Options. Style Engine

Property Show Attributes Visibility Show Base Classes Show Classifier Show Direction Arrow Show Elements List Show Entire Activation Show Full Classifier Type Show Initial Attribute Value Show Message Numbers

Function (when selected) Shows attribute visibility signs (+, -, #,~). Shows a base class on stereotype symbol. Shows a classifier name near a model element name. Shows the direction arrow on the association. The association must be set as Navigable. Shows model elements that are assigned to a model, package or subsystem as a list. Shows entire activation bar on active classifier role in sequence diagram. Shows all attributes that are defined within a class or assigned classifier. Shows initial attribute value on a class or artifact. Shows the messages numbers on a diagram.

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 Operations Constraints Show Operations Signature Show Operations Stereotypes Show Operation Parameters Direction Kind Show Operations Properties Shows tagged values and concurrency of an operation. Show Operations Visibility Show Owner Show Predecessors Show Visibility Shows operation visibility signs (+, -, ~ #). Shows the name of the owner model element (in parenthesis beneath the corresponding model element name.) Shows predecessors on message. Shows role visibility signs (+, -, #). Shows additional information sign in the class, artifact or numeration operations list, when omissions are made by editing class, artifact or enumeration compartment. Shows multiplicity value. Shows the name of a relationship, role and message/stimulus Shows constraints of operations. Shows all of the operation arguments and the return type. Shows stereotypes of operations. Shows the direction kind for operations parameters

2005 No Magic, Inc

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

Function (when selected) The color that will be used to draw stereotypes. The Color dialog box appears. The font that will be used to draw stereotypes. The Font dialog box appears. Shows stereotype labels on symbols. Shows constraints on symbols. Shows tagged values on symbols. Hides actions associated with the state. Hides attributes list. Displays only an icon of an assigned element or stereotype. NOTE Only when a model element contains an icon or a stereotype with an icon, the Suppress Content command is activated on the element shortcut menu. Hides use-case extensions on a use case. 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. Hides operations compartment section. Hides specification elements of a subsystem. Changes the text position of a separator. Possible choices: Center, Left, or Right. Wraps printed text at the edge of text container. The color of the diagram background. Click the ... button to open the Color dialog box, select the background color. Snaps paths to grid. Snaps shapes to grid. Grid size settings from 2 to 30. Shows a grid on the diagrams. Shows diagram information table on diagram pane.

Stereotype Font

Show Stereotypes

Show Constraints Show Tagged Values Suppress Actions Suppress Attributes Suppress Content

Suppress Extension Points Extension Point Color Extension Point Font

Suppress Enumeration Literals Hides enumeration literals on a enumeration. Enumeration Literal Color Enumeration Literal Font Suppress Operations Suppress Specification Elements Text Position Wrap Words Background Color Snap Paths to Grid Snap Shapes to Grid Grid Size Show Grid Show Diagram Info

Suppress Realization Elements Hides realization elements of a subsystem.

3-57

2005 No Magic, Inc.

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. Diagram. Set general options about a diagram. 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.

PROPERTIES EXTENSION BY DIAGRAM Diagrams, shapes, paths, and stereotypes properties may be extended by particular diagram type. It means that presentation style options will be applied only for the specified element symbol in the specific diagram.

To extend element properties by diagram


1 In the Project Options dialog box, the Symbols Properties Styles tree, expand a

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.

Figure 20 -- Element extension by diagram

2005 No Magic, Inc

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.

Figure 21 -- Extended diagram addition

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.

Figure 22 -- Extend by Diagram dialog box

To remove extended diagram from the tree

Select extended diagram and on the right click mouse button, choose Remove.

Figure 23 -- Remove extended diagram

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

2005 No Magic, Inc.

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.

To apply a new style for the already created element symbol


1 In the Project Options dialog box, change element style properties and click the

Apply button. The Select Diagrams dialog box appears. The list of diagrams, which were created in the project, is displayed.

Figure 24 -- Select Diagrams dialog box

2005 No Magic, Inc

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

Select Properties to Apply dialog box appears.

Figure 25 -- Select Properties to Apply dialog box

3 Choose which properties will be applied to element symbol from the All to NOTE!

Selected list. Click OK. If a new style was set, it will be applied for all newly created elements after drawing them on diagram pane. You may always set the default symbols style to element by clicking the Apply Default Symbol Style button in the main toolbar.

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

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Project Options. Style Engine

To add stereotype to the branch


1 In the Project Options dialog box, the Symbols Properties Styles tree right-click

the Stereotypes branch. The list of stereotypes appears.

Figure 26 -- List of stereotypes

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 remove stereotype from the branch


1 In the Project Options dialog box, the Symbols Properties Styles tree select the

Stereotypes branch. The list of stereotypes appears. 2 Clear the check box near the stereotype and click Apply. Stereotype is removed from the branch.

To change stereotype properties


1 Expand the Stereotypes branch and select a stereotype. 2 Set 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.

2005 No Magic, Inc

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

To apply stereotype properties when assigning stereotype to element


NOTE!

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

2005 No Magic, Inc.

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 export any module using the File menu


1 From the File main menu, choose Export, and then choose Profile/Module. The

Export Profile/Module dialog box appears.

Figure 27 -- The Select Package dialog box for module exportation

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.

To export the selected module using the package shortcut menu


1 In the Browser tree, select a package, which you want to be saved as a separate

module (multiple packages selection is possible). 2 From the package shortcut menu, choose Modules, and then choose Export Module. The Export Profile/Module dialog box appears. 3 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.
2005 No Magic, Inc
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:

documentation of the package. 5 Click OK. The Save dialog box appears. 6 Select the destination directory, where you wish to save the project module, type the file name, choose the format for saving and click OK. Only packages can be exported as modules. In order to export the created diagram, you have to move it to the package, which contains elements to export.

USING PROJECT MODULE The use module action opens the module for using it in the project. Module will be loaded in a read-only status. You may use this module in your project, although for editing you have to import this module or open it as a separate project.

To use module in the project


1 From the File main menu, choose Use Profiles/Modules. 2 In the Use Profile/Module dialog box, select the module you wish to use in your

project and click OK.

IMPORTING PROJECT MODULE After the module is opened for use or when exported, it is in the read-only status. The import module action makes a package and entire inner elements editable. Module model after importing is merged with the project model.

To make module editable


In the Browser tree, from the module shortcut menu, choose Modules and then choose Import.
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

2005 No Magic, Inc.

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.

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].

2 In the Shared Packages dialog box, the Selected Objects tree, package you

To share few packages at the same time


1 Select few packages in the Browser and then invoke the Shared Packages

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.

2005 No Magic, Inc

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

To unshare shared package


1 Select shared package in the Browser. Invoke shared package shortcut menu,

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. Cannot export package with inner shared package.

OPENING MODULE AS A PROJECT Since MagicDraw version 8.0, after opening module as a separate project, all available packages, are enabled for editing, with the corresponding module package marked as shared. When loading module as a project, it is allowed to separate existing module into submodules, make changes to the containing elements, and add the new ones.

To open module as a project


In the Browser tree, from the exported module shortcut menu, choose Modules, and then choose Open Module As Project. RELOADING MODULE The reload module action is useful to get the newest changes of the module. All modifications, which were made in the other project for this module and then module exported with the same name, will be reloaded in the current project.

To reload the module


In the Browser tree, from the exported module shortcut menu, choose Modules, and then choose Reload Module.
NOTE:

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

3-67

2005 No Magic, Inc.

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 between elements


Package can be exported into an independent module only if it does not depend on external elements (except other modules). Cyclic dependencies between several modules are not allowed. There are three types of dependencies:

Dependencies by relationships Dependencies by reference Diagrams dependencies


DEPENDENCIES BY RELATIONSHIPS

PACKAGES

Module depends on external elements


If module element has a relationship with an external element and this relationship is contained in some of module package, the error message occurs when exporting the module.

Figure 28 -- Example of module dependency on external element

Such dependency on external elements is displayed in the Browser tree:

Figure 29 -- Package has dependency on external element

2005 No Magic, Inc

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:

Figure 30 -- Resolved package dependency on external element

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.

Figure 31 -- Error in the Package Dependencies dialog box

Also you may draganddrop the relationship from one package to another manually in the Browser tree.

Module depends on external element, but can be exported (with warning)


Modules element has relationship with external element but this relationship is contained in some external package:

Figure 32 -- Example of legal module dependency on external element

3-69

2005 No Magic, Inc.

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, dependency on external elements is displayed in the Browser tree:

Figure 33 -- Legal module dependency on external element in data model browser

Package can be exported as module, because relationship is contained in external package. You will be warned about such dependencies, because they have some logical meaning:

Figure 34 -- Warning in the Package Dependencies dialog box

If you want to skip this dependency, click the Export button. After opening the module as a separate project, this relationship will be absent.

Module does not depend on external element


If module element has a relationship with external element but this relationship is meaningless in UML context (it means external model uses module, but not otherwise) and

2005 No Magic, Inc

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.

Figure 36 -- Example of dependency by reference

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.

Figure 37 -- Example of the relationship when diagram depends on external element

About the package dependency on external elements, see Section Module depends on external elements on page 3-68.

3-71

2005 No Magic, Inc.

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.

Now the module package can be exported into independent module.

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.

To open the Package Dependencies dialog box


In the Browser tree, from the package, which contains dependency with external model element, shortcut menu, choose Modules, and then choose Export Module.

Figure 39 -- The Package Dependencies dialog box

2005 No Magic, Inc

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 Status Module Element Element Type Dependency Type Depends On Solve

Function Status of the problem. It can be Error or Warning. The name of the model element. The type of the element. The type of dependency. Model element, on which the package element is dependent. Solves the Error dependencies. Enabled, when error status dependency is selected in the table and when solution of the problem can be found. The message about how dependency can be solved is displayed. Dependency status in the dependencies table is changed from Error to

Warning.

Select in Containment Tree Refresh Export

Selects the element in the Browser, which is already selected in the dependent elements table. Performs module dependency checking and refreshes module dependencies table. Exports package as a separate module. Enabled, when all module dependencies have Warning status or no problematic dependencies exist. Exits the dialog box without saving changes. Displays MagicDraw Help.

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

2005 No Magic, Inc.

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.

More about all these functions in the following sections.

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.

To create your own profile


1 Create a package with the stereotype <<profile>>. 2 Add your desired stereotypes, constraints, tag definitions, and/or other model

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.

2005 No Magic, Inc

3-74

WO R K I N G W I T H P R O J E C T S Profiles

Using and importing profiles


In your project, you may use other profiles or import them. MagicDraw offers several profiles, which you may find in the <MagicDraw installation directory>/profiles folder.

To use already created profile in your project


1 From the File menu, choose Use Profile/Module. 2 The Use Profile/Module dialog box appears. If needed select the directory

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.

To import already created profile in your project

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

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Model Differencing

Profiles dialog box

Figure 40 -- Profiles dialog box

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.

2005 No Magic, Inc

3-76

WO R K I N G W I T H P R O J E C T S Model Differencing

You may compare:


current project with locally saved project current project with opened project two teamwork project versions current project with teamwork project version. local project and teamwork project version. 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:

New model elements. Deleted model elements. Model elements with modified data. Model elements that changed location. Inner elements changes.

To choose projects you want to compare


1 Open a project you want to compare and from the Tools menu, choose

Compare Projects. 2 The Compare Projects dialog box appears.

Figure 41 -- Select Projects to Compare dialog box

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

2005 No Magic, Inc.

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. <current project>Disk version. By selecting this option you will be able to compare currently changed project version with the project version on the disc without current changes. By default the first opened project should be selected. If there are no more projects opened, value Local Project is selected.

UNDERSTANDING MODEL DIFFERENCES All model version differences are displayed in the Difference Viewer dialog box.

2005 No Magic, Inc

3-78

WO R K I N G W I T H P R O J E C T S Model Differencing

Figure 42 -- Difference Viewer dialog box

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

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Model Differencing

Elements with modified element data (modified elements). Modified element is


highlighted as changed in both trees. Modified element is highlighted in light blue color.

Elements that changed location (parent has changed). Element is marked as


modified element. Empty nodes are displayed in opposite tree where element does not exist. On moved element and on its former position button is displayed. Pressing button on former position selects place where element is moved. Pressing button on moved elements position selects former element place. Also you may perform these operations using shortcut menu commands Go to former position or Go to moved element.

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:

Element specification properties have changed. Element specification properties include all properties, which are not displayed in Browser as separate elements. Model element specification properties are treated as changed only if element property may be changed from element specification. If element specification has changed because of changes made to other elements, the element should be not treated as changed. Example: typed values in tagged values specification, attribute links in object and instance specification, etc. Element parent has changed. Path is drawn from/to element.

Buttons available in the Difference Viewer dialog box:


Button 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: All - Shows all elements of the projects. All Differences - Shows only differences made between he projects. Deleted Elements - Shows only elements that were deleted from the projects. Inserted Elements - Shows only elements that were inserted in the projects. Modified Elements - Shows only elements that were modified. The Find dialog box appears. Search for elements within the corresponding project. Find Next Element More>> <<Less Export Differences More/Less button shows/hides element properties table. By default properties table is hidden. Creates .html or .txt differences report. In the appeared Save Difference Report As dialog box, choose the directory where you want to save this report. NOTE: *.html format is suitable for viewing difference report. If you want to copy this report to other program, please use *.txt format.

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

and click the Compare Diagrams button.

3-81

2005 No Magic, Inc.

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

diagrams with changes made in them.

Figure 43 -- Diagram Difference Viewer dialog box

Diagrams Difference Viewer displays two diagrams:


Current (or first opened) project diagram is displayed at the right-hand side. Diagram that is compared with is displayed at the left-hand side. Modified symbol properties New symbol creation Symbol deletion Symbol bound changes (resize, bound changes because of element properties changes)

Symbols changes that are reflected in the diagram:


All changes are highlighted in light blue color dashes.

2005 No Magic, Inc

3-82

WO R K I N G W I T H P R O J E C T S Working with multiple projects

Buttons available in the Diagrams Difference Viewer dialog box:


Button 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).

WORKING WITH MULTIPLE PROJECTS


Because you may have to manage several projects at the same time, MagicDraw allows you to work with several projects simultaneously. All opened projects are held in separate workspaces. Different activated projects may exchange data. Entities from the one project can be copied or moved to another.

To switch between loaded projects

In the Projects drop-down combo box, click the additional project you wish to open.
2005 No Magic, Inc.

3-83

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.

To close all opened projects


Choose Close All Projects from the File menu. The Question message box appears.

Figure 44 -- Question message box

Choose the way your projects will be closed:


Yes 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. Save all projects without prompting. The Save dialog box appears for each opened project. Project you are currently closing will not be saved. The dialog box is displayed again when the next project closes. All the projects will be closed without saving and prompting. Cancels saving projects.

Yes To All No No To All Cancel

To exchange model entities between opened projects

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.

NOTE

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

2005 No Magic, Inc

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:

Creation and specification of model elements without viewing them. Copying, cutting, and pasting of model elements. Opening and deletion of model elements. 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). Hierarchical viewing of all model elements. Trace viewing for the selected model element. Symbol creation for the selected model element in the current diagram. Managing diagrams. Managing extension mechanisms such as constraints, stereotypes, and tagged values. Java reversing a class directly from classpath. Adjusting the code engineering sets. Code generation for the particular sets. 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. Sorting of the visible items for the selected model element. Sorting of all model elements. Displaying search results.

THE BROWSER WINDOW PARTS The Browser window is divided into two parts:

Containment tree/Diagrams tree/Inheritance tree/Model Extensions tree/Search Results part.

3-85

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Using Browser

The Containment tree tab groups data in the logical sets. The Diagrams tab groups diagrams that are represented on the diagram pane according to the diagrams types or shows them as a list. The Inherence tree tab represents class hierarchy of the project. The Model Extensions tree tab represents all predefined and created constraints, stereotypes, and tagged values. The Search results tab displays search results.

Documentation/Zoom Control part. The Documentation tab shows documentation associated with selected item. The Zoom Control tab is responsible for zooming current diagram.

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

2005 No Magic, Inc

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.

To change the size of either part of the Browser


Drag the bar that separates the two parts.

To change the Browser position from the Options menu


1 Choose Environment from the Options menu. The Environment Options dialog

box appears. 2 In the Browser tab, change the Browser Position property to Right or Left.

To close or reopen the desired tab of the Browser


From the Window menu, choose the tab you want to close/open.

To reset all Browser tabs to it default position


From the Window menu, choose Reset Windows Configuration command.

To sort alphabetically items in browser


1 Choose Environment command from the Options menu. The Environment

Options dialog box appears. 2 In the Browser tab, set the Sort Always check box to true (default true). The same option is available from the Browser shortcut menu.

Containment tree
The Containment tree displays model data, grouping it in logical sets.

To open the Containment tree

Click the Containment Tree tab in the upper side of the Browser.

3-87

2005 No Magic, Inc.

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.

Figure 46 -- Containment tree

To show the full information of operations, attributes, and relationships in the Containment Tree

In the Containment Tree tab, click the Show Full Types in Browser button

1 Choose Environment command from the Options menu. The Environment

Options dialog box appears. 2 In the Browser tab, set the Show Full Types in Browser check box to true (default false).

To show stereotypes in Containment tree

In the Containment Tree tab, click the Show Stereotypes in Browser button

1 Choose Environment command from the Options menu. The Environment

Options dialog box appears. 2 In the Browser tab, set the Show Stereotypes in Browser check box to true (default false).

To show/hide Code Engineering sets branch

In the Containment Tree tab, click the Show Code Engineering Sets button Options dialog box appears.

1 Choose Environment command from the Options menu. The Environment

2005 No Magic, Inc

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.

To create a new data type


choose Data Type. 2 Type the name of the data type directly in the Browser tree. For more information about managing model elements from the Browser, see Section Working with model elements in the Browser tree on page 3-95.
1 Choose New Element from the package in the Browser shortcut menu and then

CODE ENGINEERING SETS The Code engineering sets branch is a gateway between your source code and model data. Using sets, you may perform Java, C++, IDL, DDL, EJB, CIL, and C# code round-trip engineering (code generation + reverse engineering).

To create a new Code engineering set


1 Right-click the Code Engineering Sets item and choose New from the item

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.

To edit the selected set


Choose Edit from the set shortcut menu. The Round Trip Set dialog box appears. You may add/remove files or classes from the Code engineering set.

To rename the selected set


Choose Rename from the set shortcut menu and type the set name.

3-89

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Using Browser

To change code generation properties


Choose Properties from the set shortcut menu. The CG Properties Editor dialog box appears. The detailed description about the CG Properties Editor dialog boxes, see MagicDraw Help.

To delete the selected set


Choose Delete from the set shortcut menu.

To restore the deleted set


From the Edit menu, choose Undo or press shortcut keys CTRL+Z.

To generate code from the selected set


1 Choose Generate from the set shortcut menu. The Code Generation Options

dialog box appears. 2 Adjust your own code generation options. 3 Click OK. The Messages Window dialog box appears. You may see information about generated files.

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.

To reverse the selected set


1 Choose Reverse from the set shortcut menu. 2 The Reverse Options dialog box appears. Define options and click OK.

For the detailed descriptions about the reverse, see Section Reverse in the Code Engineering Users Guide.

To reverse files that have been changed


1 Choose Refresh from the set shortcut menu. 2 The Reverse Options dialog box appears. Define options and click OK.

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.

To choose a text editor for source code


1 Choose Editor Properties from the set shortcut menu. The Editor Properties

dialog box appears.

2005 No Magic, Inc

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.

To reverse a class from a classpath (Java)


Choose Reverse from Classpath command from the selected class (Data package) shortcut menu.
NOTE

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.

Figure 47 -- Diagrams tree

In the Diagrams tree, with the selected diagrams, you may perform the operations listed below.

To group diagrams according their diagrams types


Click the Group by Diagram Type button

in the Diagrams tree.

From the shortcut menu, select the Group by Diagram Type check box.

To open the selected diagram from the Browser


Choose Open from the item shortcut menu or double-click the item of the diagram.

3-91

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Using Browser

To delete the selected diagram


Choose Delete from the selected diagram shortcut menu.

To rename the selected diagram


Choose Specification from the diagram shortcut menu. The corresponding Diagram Specification dialog box appears. Type the diagram name and click OK.
TIP!

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.

To print the selected diagram

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.

Figure 48 -- Inheritance tree

2005 No Magic, Inc

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.

To show stereotypes in Inheritance tree

In the Inheritance Tree tab, click the Show Stereotypes in Browser button

1 Choose Environment command from the Options menu. The Environment

Options dialog box appears. 2 In the Browser tab, set the Show Stereotypes in Browser check box to true (default false).

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.

Figure 49 -- Model Extensions Tree

To group extensions by profiles


In the Model Extensions Tree, click the Group by Profiles button

From the Model Extensions Tree shortcut menu, select the Group by Profiles check box.

3-93

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Using Browser

To group extensions by their base classes


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.

Figure 50 -- Search Results tab

The results in the tab are dispalyed in two packages:

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.

How to perform search, see Section Searching on page 3-99.

To open the Find dialog box, from the Search Results Tree
Click the Find button , or press CTRL+F keys.

To clear the results of the previous search


Click the lear Clear Results button Search Results tab. or select the Clear Results button from the

2005 No Magic, Inc

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

Choose Copy or Cut from the item shortcut menu. Change the project name in the Projects list on main window toolbar. Select where you wish to put the copy of the element. Choose Paste from the item shortcut menu.

To delete a model element from the Browser tree


Choose Delete from the item shortcut menu.

To drag-and-drop the selected item in the Browser tree


1 Make sure that the place you wish to drag the item is visible. 2 Drag the selected item to the destination and drop it.

To draw a symbol on the diagram


Choose Create Symbol from the items in the Browser shortcut menu.
NOTE

You may draw a symbol by dragging and dropping an item to the Diagram pane

To show/hide model elemens in the Browser tree


1 Right-click in the Browser. 2 From the shortcut menu, choose Filter. 3 The Items Filter dialog box appears. Clear the check boxes of those model

elements that you would not like to appear in the Browser tree

3-95

2005 No Magic, Inc.

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.

To make multiple selections

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.

To select all model elements or all browser tree items


Click the mouse pointer in the area you want to select all elements and press shortcut keys CTRL+A.
NOTE

All selected model elements can be moved or deleted as a single selected element. While moving the set MultipleDrag, a border appears denoting the area you have selected. Be careful when deleting multiple elements because no confirmation dialog box will appear.

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.

2005 No Magic, Inc

3-96

WO R K I N G W I T H P R O J E C T S Using Browser

To open the Documentation tab


Click the Documentation tab in the lower side of the Browser window or from the Window menu, choose Documentation. If there is no documentation for the selected element, No documentation message is displayed in the section.

To write documentation for the selected model element


1 Click the Documentation tab. 2 Type information.

ZOOM CONTROL TAB In this tab, you may preview the desired diagram simply by selecting it in the Browser on on the Content diagram. Also you use this tab for zooming the diagram.

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.

To fit diagram in window, through the Zoom Control tab


Click the Fit in Window button on the square in the Zoom Control tab.

3-97

2005 No Magic, Inc.

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.

Figure 51 -- Customize Properties dialog box

2005 No Magic, Inc

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.

To find quickly the needed classifier or diagram


From the Edit menu, choose Quick Find. In the appeared screen, type the name of the classifier or diagram (also you may choose it from the drop-down list), and choose one of the needed option buttons.

Figure 52 -- Quick Find screen

Find all elements of some type


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.
1 From the Edit menu, choose Find, or press corresponding shortcut key Ctrl+F ,

TIP!

Find model elements and symbols in your project


click the Search tab in the Browser. 2 In the Name text box, type the name of the element. If you want to find all elements of the selected type, enter the "*" symbol in the Name text box. 3 Click the "..." button near the Type text box to open the Select Model Element/Symbol Types drop-down combo box. Select types of elements and click OK. Model elements in this box are listed according metamodel. 4 To start search, click the Find button. The search results appear in the Search Results 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.
2005 No Magic, Inc.

1 Choose Find from Edit menu or press corresponding shortcut key Ctrl+F or

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. Select Search Data Unused in Diagrams check box to find only elements lacking shapes.

TIP!

Find dialog box

Figure 53 -- Find dialog box

The Find dialog box contains five tabs:


Search Element by Name tab Search Element by Stereotype tab Search Element by Tagged Value tab Search Element by Constraint Value tab Search Element by Documentation tab

Element

Function

2005 No Magic, Inc

3-100

WO R K I N G W I T H P R O J E C T S Searching

Name

Type the name of the item you wish to find. NOTE: You may define wildcards <*> and <?> for the search. For example, if you define the following input string <a*b>, the system looks for items with <a> at the beginning and <b> at the end of the string. If you define such string as <?agicDraw>, all strings containing <agicDraw> will be found. Select a type of elements from the proposed items, or leave this field empty. Select or type a value of Tagged Value or Constaint.

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. 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. Searches only elements that do not contain symbols in any diagram. In the Section Java Regular Expressions on page 3 -101, you may find several expressions that will help you to make a search in MagicDraw. Removes from the Browser tree all previously found items. 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. Exits the dialog box. Displays MagicDraw Help.

Match Whole Words Only

Search Data Unused in Diagrams Java Regular Expression Clear Previous Results Find

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

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Searching

There are two ways to force a metacharacter to be treated as an ordinary character:


+ Precede the metacharacter with a backslash + Enclose it within \Q (starts the quote) and \E (ends it).

CHARACTER SETS
[abc] [^abc] ) [a-z] [a-z[A-Z]] [a-z&&[r-z]] [a-z&&[^r-z]] Any character of a, b or c Any character except a, b or c (negation All character from a to z (range) All characters from a to z and A to Z (union) Character from r to z (intersection) Characters from a to q (subtraction)

Predefined character sets:


. \d \D \s \S \w \W Any character Any digit character Any non digit character White space character (\t\n\x0B\f\r) Any non white character Word character (a-z, A-Z,_,0-9) Any non word character

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} Match X zero or one time Match X zero or many time Match X one or many time Match X exactly n times

2005 No Magic, Inc

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}

Match X at least n times Match X exactly n, but not more than m times

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 \B \A \z Beginning of the line The end of the line A word boundary A non word boundary Beginning of the input End of the input

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) Case insensitive matching Ignores white spaces in regular expression Enabled multi line option. If not specifies boundary matches ^ and $ matches beginning of the input and end respectively. Enables expression "." to match any character including line terminators. If not specified, dot in expression doesn't match line terminators. Enable Unicode-aware case folding. When this flag is specified, case insensitive is done regarding to Unicode standard. Enable Unix lines mode. Only terminator '\n' is recognized in behaviour of ".","^","$"

(?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

2005 No Magic, Inc.

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

MAGICDRAW AND RATIONAL ROSE


MagicDraw supports Rose XMI model exchange model.

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.

Figure 54 -- Unisys Rose XMI export/import menu items

To export the opened Rational Rose project to XML file.


1 From the Tools menu, choose the Export Model to UML command. The Unisys

Rose UML Export Options dialog box appears. 2 From the XMI Format group box, select the XMI 1.0 option button (only XMI 1.0 format is supported by MagicDraw.)
2005 No Magic, Inc
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.

Figure 55 -- Unisys Rose UML 1.3.4 Export Options dialog box

5 The Save XML File dialog appears. 6 Type the name of the XML file and choose the directory where to save the file. NOTES:

Before exporting Rational Rose project, it must be saved as MDL file. While exporting: XMI 1.0 and Model option buttons should be selected.

To import a model from XMI format


1 From the Tools menu, choose the Import UML Model command. 2 The Import XML File dialog appears, choose the desired XML file and click

Open. 3 The Rose UML Import Options dialog appears, click OK.

Figure 56 -- Rose UML Import Options

4 Creates a new project and imports model from XML file.


3-105

2005 No Magic, Inc.

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

directory where to save the file.

To open the XML file exported by Rational Rose


1 From the File menu, choose the Open Project command. 2 The Open dialog box appears. Choose the desired project file and click the

Open button.

2005 No Magic, Inc

3-106

WO R K I N G W I T H P R O J E C T S MagicDraw and Rational Rose

Metamodel and XMI incompatibilities


Field Common Rational Rose does not support

MagicDraw does not support Names of the model elements can be not unique because data is collected according to ID.

Constraints and Constraint link Tag Definitions Multiple stereotypes for model elements Names of the model elements must be unique because data is collected according to name. 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.

Class diagram

MagicDraw does not have Association Class element (Link Attribute + Class).

Use Case diagram

Collaboration diagram

3-107

2005 No Magic, Inc.

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

Rational Rose does not support


MagicDraw does not support

Diagonal message Concurrent Lifeline Recursive Message Action State (is imported as Activity) 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 Activity) Action State (is imported as Activity) Concurrent State (is imported as State) Call State (is imported as Activity) Submachine State (is imported as State) Subactivity State (is imported as Activity) Signal Receipt Signal Sending Object Flow state Swimlanes are not displayed in diagram.

State diagram (Statechart diagram in Rose)

Activity diagram

2005 No Magic, Inc

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)

Rational Rose does not support


MagicDraw does not support Connection (element not defined by UML 1.4)

Nodes are imported as Processors in Deployment View Associations between Nodes are imported as Connections (Connection name is not imported/exported) Dependency between Node elements Artifact Package Instance Node Instance Component Instance Interface Class (also corresponding relationships are not supported) Link Association between Component elements Abstraction between Component elements (is exported as Dependency)

OTHER

NOTICED INCOMPATIBILITIES

Unisys XMI format does not support rectilinear property and breakpoints for relationships in the diagrams. Rational Rose exports Class Instance elements as Object elements. Rational Rose does not export symbol style for Package, Message, Component, Transition, Synchronization and Swimlane. Rational Rose does not export Stereotype display option. 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.

MAGICDRAW AND TOGETHER CONTROLCENTER


MagicDrawTM supports Unisys XMI Extensions model exchange model.

3-109

2005 No Magic, Inc.

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.

Figure 57 -- Export to XMI dialog box

3 Choose where to save the file and click OK. NOTES:

While exporting: XMI 1.0 for UML 1.3 (Unisys Extension) check box should be selected.

To import a model from XMI format


1 From the File -> Import menu, choose the Model from XMI File command.

2005 No Magic, Inc

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

click the OK button.

Figure 58 -- Select XML Document dialog box

3 Model from XML file is imported into project.

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

directory where to save the file.

To open the XML file exported by Together ControlCenter


1 From the File menu, choose the Open Project command.

3-111

2005 No Magic, Inc.

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.

Metamodel and Unisys XMI incompatibilities

Field Common

Together ControlCenter does not support


MagicDrawTM does not support

Constraints and Constraint link Tag Definitions Multiple stereotypes for model elements Names of the model elements must be unique because data is collected according to name. Data Type Primitive Programming Language Data Type Enumeration Collaboration Object and Link Subsystem and Model (are imported as Packages with appropriate stereotypes) Containment link Does not export Generalization link view Implementation link is exported as generalization Does not import Abstraction Include relationship is exported as Generalization with <<include>> stereotype Extend relationship is exported as Generalization with <<extend>> stereotype. Does not export System Boundary. Extension Point Collaboration Dependency between Use Cases, between Actor and Use Case

Class diagram

Use Case diagram

2005 No Magic, Inc

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

Does not export messages 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. Does not export messages Diagonal message Concurrent Lifeline Recursive Message

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) Action State (is imported as Does not import Activity Activity in <default> diagram) diagram Concurrent State (is imported as State) Call State (is imported as State) Submachine State (is imported as State) Subactivity State (is imported as Activity) Signal Receipt (is imported as State) Signal Sending (is imported as State) Object Flow state (is imported as State) Swimlanes are not displayed in diagram.

Activity diagram

3-113

2005 No Magic, Inc.

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)

Nodes are imported as Processors in Deployment View Association name is not imported Dependency name is not imported Artifact Instance Node Instance Component Instance Link Abstraction Does not export Component, Interface, Object, Association, Dependency from Deployment diagram

Does not import Supports link (element not defined by UML 1.4)

OTHER

NOTICED INCOMPATIBILITIES

Together ControlCenter does not export stereotypes. Together ControlCenter does not export note link.

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.

There are the following benefits of the Resource Manager functionality: Benefits:

Easier to find needed resource and download it. More informative resources description. Possibility to create your own resources and share them. Possibility to check resource dependency in required table

Resource Manager functionality is included in all MagicDraw editions, except, Reader.

2005 No Magic, Inc

3-114

WO R K I N G W I T H P R O J E C T S Resources Manager

To invoke the Resource Manager:


From the Options main menu, choose the Resources command. The Resource Manager window appears.

In the table bellow is listed items of the Resource Manager window.


Element Name Name Function Different types of resources are listed in separate nodes. There are the following resources types: examples, templates, languages, profiles. In the front of each resource are check box. Select this check box, for managing this resource. If resource is unavailable it is impossible to select check box in front of it (checkbox is grey). Required table rows contains information why it is not available. Resource ID. Resource type. There are possible the following states of resources: Not installed (downloaded), Will be installed after restart, Installed, Will be removed after restart, Not downloaded, removed (if resource not exists on web). The Version Obtained column indicates version for resources with state: installed, not installed, and removed. Column Version Available indicates newest resource version on web. Not exist on web. If resource not exist on web. Check for updates. If resource list has not been downloaded from web.

ID Category State

Ver Obtained Ver Available

3-115

2005 No Magic, Inc.

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

Resource creation date. Size of the particular resource. In one row are listed text color meanings: Green - installed resources are marked green. Blue- Not downloaded resources are marked blue and if already installed or downloaded resource newer version is available is marked blue. Black - changes will be fully applied after restarting MagicDraw. Expands / Collapse main Resource Manager window with additional fields. In the following fields are listed all data of the selected in the list resource: Name, Resource home page, Provider, Description Required table (with Name, Required, Status columns). If resource is installed but newer version is available on web, required table shows newest version requirements. The Check for Updates button is inactive if resource list is already successfully downloaded. Downloads selected resources and installs. The Download/Install button is inactive if no resources are selected. Button is active if at least one resource is selected with states not installed or installed. Resources of other states may not be removed from RM list. Remove functionality is not available for necessary resources. The Open dialog is invoked. Import the resource you need.

More>>/<<Less

Check for Updates Download/Install Remove

Import
NOTE

If resource requires fee-paying, in the Resource Manager window, the Price column price of the particular resource is displayed.

2005 No Magic, Inc

3-116

WO R K I N G W I T H P R O J E C T S Resources Manager

3-117

2005 No Magic, Inc.

WO R K I N G W I T H P R O J E C T S Resources Manager

2005 No Magic, Inc

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 shape refers to a notation of a model element such as a package, class, state, use case, object, and others. A path refers to the notation for the various kinds of relationships such as associations, aggregations, dependency, message, and links. Both paths and shapes are defined as symbols.

In this Section, you will find the following chapters:


1 "Working with Diagrams", on page 120 2 "Drawing Shapes", on page 126 3 "Drawing Relationship paths", on page 129 4 "Smart Manipulation", on page 130 5 "Selection. Multiple Selection", on page 131 6 "Dragging, Copying, Cutting, and Pasting", on page 132 7 "Specifying Model Elements", on page 133 8 "Model Traceability", on page 146 9 "Laying out", on page 153 10"Zooming", on page 162 11"Using Grid", on page 163 12"Assigning Shortcut Keys", on page 164 13"Printing", on page 165 14"Model Elements Common in all Diagrams", on page 169

WORKING WITH DIAGRAMS


TIP!

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.

To create a new diagram

Using toolbar buttons: Click the desired diagram button on the toolbar. The Create Diagram dialog box

2005 No Magic, Inc.

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.

Through the Diagrams menu: From the Diagrams menu, choose the desired diagram. The corresponding Diagrams dialog box appears. Click the Add button. The Create Diagram dialog box appears. Enter the name of the diagram and select or create a package where you wish to create your diagram. From the Browser: Right-click the desired model element in which you would like to create a diagram and, from the shortcut menu, choose New Diagram or New. The the Diagram Specification dialog box appears. In this dialog box you may define diagram name, enter documentation, define stereotypes, tagged values, and/or constraints. From the model element Specification dialog box: Open the Package, Subsystem, or Model Specification Inner Elements tab or Use Case Specification dialog box, Diagrams tab. Click the Add button. The corresponding Diagram Specification dialog box appears. In this dialog box, you may define diagram name, enter documentation, define stereotypes, tagged values, and/or constraints.

NOTES

You may create a diagram in the selected package, model, or subsystem. Use case, collaboration, sequence, state, and activity diagrams can also be created in use cases. State and activity diagrams can be created from the Assign State/Activity Diagram dialog box by clicking the New button.

To open diagram

From the Browser: Choose Open from the diagram item shortcut menu or double-click the diagram item. Through the Diagrams menu: From the Diagrams menu, choose the desired diagram. The corresponding Diagrams dialog box appears. Click the Open button. From the content diagram (available only in the Enterprise edition). If the diagram is assigned to some model element, by double clicking this model element.

TIP 1! TIP 2!

To open all diagrams, that are created in the project, from the Diagrams menu, choose Load All Diagrams. 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. In the Environment Options dialog box, General pane, you may choose a way for loading diagrams while opening a project. Three options are available:
2005 No Magic, Inc.

TIP 3!

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

Figure 59 -- 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.

Diagrams dialog box


The Diagrams dialog box is used for the following purposes:

For viewing the owner of the diagram


4-122

2005 No Magic, Inc

DIAGRAMS BASICS Working with Diagrams

For creating a new corresponding type of diagram. For editing the name and other characteristics of the diagram. For removing a diagram from the project. For opening a diagram.

To open the corresponding Diagrams dialog box


From the Diagrams menu, choose one of the diagrams. Depending on the type of the diagram, the opened dialog box has a corresponding title.

Figure 60 -- Diagrams dialog box

The Diagrams dialog box contains the following elements.


Element name Function Name Owner Edit Add Remove Open OK Cancel Help The names of all created corresponding diagrams in the opened project. The name of the package that owns the diagram. The Diagram Specification dialog box appears. Type the diagram name, select a package, and click OK. Creates a new diagram. The Create Diagram dialog box appears. Type the diagram name, select a package, and click OK. Deletes the selected diagram. Opens the selected diagram. Saves all actions performed during the session and exits the dialog box. Cancels all actions performed during the session and exits the dialog box. Displays the MagicDraw Help.

4-123

2005 No Magic, Inc.

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.

To open 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.

Figure 61 -- Diagram Properties dialog box

The Diagram Properties dialog box contains the following elements.


Element name Background Color Function Set diagrams background color. Click the ... button. The Color dialog box appears. Set color in the three different ways: using Swatches, HSB, or RGB tabs. Shows grid on the Diagram pane. Uses grid on diagram for drawing paths. Uses grid on diagram for drawing shapes. Set grid size from 2 to 30.

Show Grid Snap Paths to Grid Snap Shapes to Grid Grid Size

2005 No Magic, Inc

4-124

DIAGRAMS BASICS Working with Diagrams

Element name Show Message Numbers


(Available only for Collaboration and Sequence diagrams)

Function Displays message numbers on the diagram.

Show Activations
(Available only for Sequence diagrams)

Displays activation bars on the diagram. Displays the table on the diagram with the information about the diagram (Diagram name, Author, Creation date, Modification date, etc.) What information will be included in the diagram you may set in the Project Options dialog box (Options menu->Project). Select the predefined style. Make the specified style as default. Saves changes and exits the dialog box. Exits the dialog box without saving changes. Displays MagicDraw Help.

Show Diagram Info

Apply Style Make Default OK Cancel Help

TABLE WITH DIAGRAM INFORMATION On the diagram, you may display a table with the information about when the diagram was created and modified, its name, author, status, and any other desired information. By default the table is placed in the upper left corner, although you may drag and drop this table whenever you want on the diagram. By default the table includes the following fields:

Diagram name Author Creation date Modification date other available tag definitions

To show the table with information about the diagram


1 From the diagram shortcut menu, choose Show Diagram Info. 2 The table with the predefined information will be displayed on the diagram.

To define the information that will be included in the table


1 From the diagram info table shortcut menu, choose Customize or from the

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

2005 No Magic, Inc.

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.

To draw a number of shapes on the diagram pane


1 Click the shape button on the diagram toolbar, or press the appropriate 2 3 4 5

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.)

To draw a shape for the selected item in the Browser tree


1 Activate a diagram on which you wish to draw a shape. 2 From the Browser tree, select an item you wish to draw. 3 From the item shortcut menu, choose the Create Symbol command or drag and

drop the selected model element onto the diagram pane.

To specify the name of the shape (if it is allowed)


1 Double-click the shape or choose Specification from the shape shortcut menu.

The corresponding Specification dialog box appears. 2 Type the shape name in the Name text box and click OK.
2005 No Magic, Inc

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.

To create several shapes with the same data

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.

1 Specify a shape name. 2 Draw another shape for the same kind on the Diagram pane. 3 Click the shape in the name area. The list of existing shape names

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.

IMPORTANT If you attempt to enter an existing name in the corresponding Specification

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.

To display elements that are related to the selected one by relationships


1 From the shape shortcut menu or from the Edit menu -> Symbol, choose

Display Related Elements.

4-127

2005 No Magic, Inc.

DIAGRAMS BASICS Drawing Shapes

2 The Display Related Elements dialog box appears.

Figure 62 -- Display Related Elements dialog box

3 Choose the desired options for displaying the related elements: Option name Function Expand Relations Choose what kind of elements should be displayed on the diagram: Clients Suppliers Both Scope Choose where the elements related to the selected model element: Whole Project Package Describes how far by selected relationships search must be performed: Indefinite. All possible related relationships are involved. Definite. Specify the level of hierarchy of the involved relationships. Select the relationships you want to be displayed on the diagram.

Depth

Relations

2005 No Magic, Inc

4-128

DIAGRAMS BASICS Drawing Relationship paths

To display paths among shapes that already are created in the model data

From the shape shortcut menu, choose Display Paths. Select a symbol and from the Edit menu, choose Symbol and then choose Display Paths.

To delete the selected model element or only symbol


From the Edit menu, choose Delete (data together with symbol is deleted.) On the main toolbar, click Delete (data together with symbol is deleted.) Press CTRL+D keys (data together with symbol is deleted.) Press Delete key (only symbol without data is deleted.) When deleting paths by pressing DELETE key, the Delete Data? message appears. To delete the relationships data from the model click Yes. When you use other methods to delete relationships, relationship data is automatically 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.

To create a number of paths


Click the appropriate path button on the diagram toolbar. Click the Sticky button on the Diagram toolbar (shortcut key Z.) Click the first (source) shape of a path. Drag the path to the second (target) shape of a path and drop it there. Click the first (source) shape of a path of the next path. Drag the path to the target shape and drop it there. The new path is created between two shapes. Repeat this until you create a desired number of paths of that type. 7 Click the Sticky button on the Diagram toolbar (shortcut key Z.)
1 2 3 4 5 6

To change the appearance style of the paths


1 Select the path.

4-129

2005 No Magic, Inc.

DIAGRAMS BASICS Smart Manipulation

2 Right-click the path or choose Path from the Edit menu, and choose the

commands you need: To set the path as rectilinear, oblique, or bezier, choose Path Style.

To choose in turn one of the path styles, choose Change Path Style (shortcut keys CTRL+L.) To reset path labels to the default position, choose Reset Labels Positions. To remove all angles of the path, choose Remove Break Points.

NOTES:

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. Remove the manipulation highlighting in the Environment Options dialog box. For more information, see Section Environment Options on page 2-24.

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.

Suppressed attributes and operations:

2005 No Magic, Inc

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 All kinds of instances All kinds of states Component Note Paths Suppress attributes, suppress operations, draw generalization, draw aggregation. Draw include, extend, and association. Draw dependency Draw link Draw transition Draw association Anchor to note Reset labels position

To hide smart manipulation


1 From the Options menu, choose Environment. The Environment Options dialog

box appears. 2 In the Diagram pane, set the Use Smart Manipulation check box to False and click OK.

SELECTION. MULTIPLE SELECTION


Two ways to select a shape

Click the desired shape on the Diagram pane. Click a shape item in the Containment or Inheritance branch of the Browser tree, and choose Tracing from the item shortcut menu. Then select a diagram and click Open.

To deselect the selected shape


Click outside the shape on the Diagram pane.

To make a multiple selection


1 Click the shape on the Diagram pane. 2 Hold down SHIFT key and click another shape. Repeat until you select a desired

number of shapes.

4-131

2005 No Magic, Inc.

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.

To select all shapes of the same type


Press ALT and click the shape. All shapes of the same type are selected.

To select all shapes on the diagram


From the Edit menu, choose Select All (shortcut keys CTRL+A.)

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.

To drag a number of selected symbols


Select symbols and drag them to the desired area on the Diagram pane.

To copy a shape using dragging-and-dropping


Hold down CTRL key when you drag the selected shape to the area where you wish to make a copy.

Drag and drop items from browser to diagram pane


1 In the Browser tree, select the created model element you wish to draw. 2 Drag it to the desired location on the Diagram pane and drop it there. NOTES:

The element will be drawn with its existing relationship. 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.

To copy/cut and paste the selected shape on the diagram


1 From the Edit menu, choose Copy/Cut (shortcut keys CTRL+C/CTRL+X.) 2 From the Edit menu, choose Paste (shortcut keys CTRL+V.) NOTE:

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.)

2005 No Magic, Inc

4-132

DIAGRAMS BASICS Specifying Model Elements

To copy the whole diagram and paste it to MS Office or other application


1 Select or deselect all model elements on the diagram. 2 From the Edit menu, choose the Copy as EMF or Copy as JPG command

(shortcut keys CTRL+SHIFT+E or CTRL+SHIFT+J.) 3 Open the desired application and paste the copied diagram.

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.

SPECIFYING MODEL ELEMENTS


You may define all model elements in the corresponding Specification dialog boxes. Using shortcut menus, toolbars, and the Browser makes editing of model elements easier.
IMPORTANT Since version 8.0, MagicDraw enables to edit model element and symbol

properties directly from the Browser, Quick Properties tab. More about this functionality, read in Section Properties tab on page 3-98.

Specification dialog boxes


To open the corresponding Specification dialog box

Choose Specification from the selected symbol shortcut menu. Double-click a symbol on the Diagram pane or Browser. Select a symbol on the Diagram pane and press ENTER key. 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

2005 No Magic, Inc.

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.

Figure 63 -- Relations tab

Element name Name Type Begins Ends Edit Remove Filter

Function Name of the relationship (optional). Relationship type. Click the Edit button, or double-click the relationship type, to open the element Specification dialog box. Relationship source. The name of the shape from which the path begins. Relationship destination. The name of the shape where the path ends. The element Specification dialog box appears. Removes the selected relationship from the list. Choose the relationships you want to be displayed on the diagrams in the Relation Types dialog box.

2005 No Magic, Inc

4-134

DIAGRAMS BASICS Specifying Model Elements

STEREOTYPES

TAB

Figure 64 -- Stereotypes tab

Element name Profile All Selected > < >> << Edit Stereotypes

Function The list of profiles that are available for the project. The list of all stereotypes that are predefined to the selected model element. 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. The Profiles dialog box appears. Edit, add, or remove stereotypes for the selected model element.

4-135

2005 No Magic, Inc.

DIAGRAMS BASICS Specifying Model Elements

TAGGED VALUES

TAB

Figure 65 -- Tagged Values tab

Element name Profile

Function The list of profiles that are available for the current project. If tag definitions are grouped and those groups are collapsed, expands those groups. If tag definitions are grouped and those groups are expanded, collapses those groups. Displays in the list only those tag definitions that have values. If tag definition are grouped into specific packages, shows those packages on the list by grouping tag definitions. Sorts tag definitions by the assigned stereotypes.

Expand All Tree Branches Collapse All Tree Branches Show Tag Definitions with Values

Show Tag Definitions Groups

Group By Stereotype Displays that types of tag definitions in the list. Show Tag Definitions Types

2005 No Magic, Inc

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

Create a value for the selected tag definition. The right pane of the dialog box is activated. Choose or enter the value. All data types and types of metamodel can be the types of values.

Remove Value Removes the value(s) from the selected tag definition. (available only when the tag definition has value) Edit Value Edit Tag Definitions The Tagged Value Specification dialog box appears where you may edit or extend the selected tagged value. The Profiles dialog box appears. Edit, add, or remove tag definitions for the current model element. Click the ... button and edit the selected tag definition in the Tag Definition Specification dialog box. Set tagged value text as HTML. Type or choose the value. Edit the selected value. Add the new value. Removes the selected value.

Right pane of the dialog box Tag Definition ... HTML Value (if the value is added) Edit Add Remove

4-137

2005 No Magic, Inc.

DIAGRAMS BASICS Specifying Model Elements

CONSTRAINTS

TAB

Figure 66 -- Constraints tab

Element name Add Remove ...

Function The list of constraints assigned to the current model element. Creates a constraint. Use the Name and Expression boxes to change the constraints parameters. Removes the selected constraint from the list. To edit common model constraints or add common constraint to a particular element list of constraints, click the button. The Profile dialog box appears where you may manage constraints ant other extensions. Enter the name of the constraint. Shows the type of the base classes. Enter an expression of the constraint. If selected, the expression is checked according Object Constraint Language (OCL) 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.

Name Base Classes Expression Check OCL Syntax Documentation

2005 No Magic, Inc

4-138

DIAGRAMS BASICS Specifying Model Elements

GENERAL

TAB

Name text box

Type or view the model element name. If you enter the name of the already existing model element, an error message box appears.

1 is set. You may change this name to your own name.


Documentation field

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 Text Color Font Name Font Size Bold Italic Underline Align left Center Function Choose font color of the text. Choose font style of the text. Choose font size of the text. Set text as bold. Set text as italic. Set text as underlined. Align text to left side border. Layout the selected text to the center.

4-139

2005 No Magic, Inc.

DIAGRAMS BASICS Specifying Model Elements

Button Align Right Insert Hyperlink Unordered list Ordered list Decrease Indent Increase Indent HTML Source

Function Align the selected text to right side border. Add a hyperlink to the desired file, model element, or web page for the selected text. The Insert Hyperlink dialog box appears. Change text style to bullet list. Change text style to numbered list. Decrease indent by moving text closer to the left border. Increase indent by moving text closer to the right border. Show text with HTML source characters.

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 Abstract Function Specifies whether the generalizable element may or may not have a direct instance. True indicates that an instance of the generalizable element must be an instance of a child of the generalizable element. False indicates that there may an instance of the generalizable element that is not an instance of a child. An abstract generalizable element is not instantiable since it does not contain all necessary information. Specifies whether the generalizable element is without descendents. True indicates that it may not have descendents False indicates that it may have descendents (whether or not it actually has any descendents at the moment.) Specifies whether the generalizable element is a root generalizable element with no ancestors. True indicates that it may not have ancestors, false indicates that it may have ancestors (whether or not it actually has any ancestors at the moment.)

Leaf

Root

2005 No Magic, Inc

4-140

DIAGRAMS BASICS Specifying Model Elements

ATTRIBUTES

TAB

Figure 67 -- Attributes tab

Attributes tab contains the model element attributes list and buttons for editing attributes list.
Name Classifier Type Initial Value Edit Add Remove Filter Attributes name. Class name that contains the current attribute. Attributes type. It can be a primitive type or another class. Attributes initial value. The Attribute Specification dialog box appears. Specify attribute, change name, define the name of a class, etc. Add a new attribute to the class. The Attribute Specification dialog box appears. Remove the selected attribute from the class. Filters attributes in the list. The list of filter options appears: Show all base class attributes attributes list shows current and all base classs attributes. Show public base class attributes attributes list shows current and the public base classs attributes. Show public and protected base class attributes attributes list shows current, public and protected base classs attributes. Do not show base class attributes attributes list shows only current classs attributes.

4-141

2005 No Magic, Inc.

DIAGRAMS BASICS Specifying Model Elements

OPERATIONS

TAB

Figure 68 -- Operations tab

Operation tab Contains model element operations list and buttons for managing this list.
Name Classifier Return type Edit Add Remove Filter Operations name. Classifiers name that contains current operation. Operations return type. The Operation Specification dialog box appears. Specify operation, change name, define classs name, etc. Add a new operation to the model element. The Operation Specification dialog box appears. Remove the selected operation from the model element. Filters attributes in the list. The list of filter options appears: Show all base class operation operations list shows current and all base classs operations. Show public base class operations operations list shows current and the public base classs operations. Show public and protected base class operations operations list shows current, public and protected base classs operations. Do not show base class operations operations list shows only current classs operations.

2005 No Magic, Inc

4-142

DIAGRAMS BASICS Specifying Model Elements

HYPERLINKS TAB In the Hyperlinks tab, manage the hyperlinks you want to add to the model element.

Figure 69 -- Specification dialog box. Hyperlinks tab

Active Hyperlink Edit Add Remove

If selected, the hyperlink is activated and will work when doubleclicking the model element. The information about hyperlink - diagram or element name, file path, or url name. The Insert Hyperlink dialog box appears. Edit the selected hyperlink. The Insert Hyperlink dialog box appears. Select the hyperlink you want to add to the model element. Remove the selected hyperlink from the model element.

4-143

2005 No Magic, Inc.

DIAGRAMS BASICS Specifying Model Elements

BUTTONS

AVAILABLE IN THE

SPECIFICATION

DIALOG BOXES

Button OK Cancel Help Owner

Function Saves changes and exits the dialog box. Exits the dialog box without saving changes. Displays MagicDraw Help. Displays the Specification dialog box of the model element that owns the current element.

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.

To set a symbols properties (fill color, text color, etc.)


From the symbol shortcut menu, choose Symbol(s) Properties. 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

To show/hide model element constraints, stereotype and/or tagged values on the diagram pane

Select/clear the Show Constraints, Show Stereotype, and/or Show Tagged Values check boxes from the symbol shortcut menu.

2005 No Magic, Inc

4-144

DIAGRAMS BASICS Specifying Model Elements

1 From the Options menu, choose Project. 2 The Project Options dialog box appears. Select the Show Constraints, Show

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.

To add a model element to a package, model (system boundary) or subsystem

Drag a model element to the desired package on the Diagram pane or in the Browser tree. Open the Package, Model, or Subsystem Specification dialog box, Inner Elements tab. Click the Add button and choose a model element or diagram you want to add to a package. Define a model element or diagram in the opened Specification dialog box and click OK. 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.

To display/hide the package/system boundary/subsystem name (the owner of an actor) on a model element

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.

TIP!

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.

4-145

2005 No Magic, Inc.

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.

To search for usages / dependent elements:


1 Select model element in the Browser or on the diagram pane. 2 From the shortcut menu, choose the Related Elements command and then Find

Usages or Find Dependent Elements command. The Find Usages / Dependent Elements Options dialog box appears. 3 Specify options and click OK. The Elements Using or Dependencies window is opened.

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.

Dependent Elements functionality


Dependency is converse to Elements Using window results. In the Dependencies window are listed elements, which are depend on current element. For example: If element1 has reference to element2. This means that element1 depends on element2.

2005 No Magic, Inc

4-146

DIAGRAMS BASICS Model Traceability

FIND USAGES / DEPENDENT ELEMENTS OPTIONS DIALOG BOX In the Find Usages / Dependent Elements Options dialog box, you may specify options of usages/dependencies functionality. You may specify search options and visualization options. The Find Usages / Dependent Elements Options dialog box is and for Usages and for Dependent Element functionality. It means if you would search for usages and clear/select one of the check boxes in the Find Usages / Dependent Elements Options dialog box, next time then you will search for dependencies, value of this check box will be the same.

To open the Find Usages / Dependent Elements Options dialog box:


1 Select a model element in the Browser tree or on the diagram pane. 2 Choose the Related Elements command from the shortcut menu and then Find

Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements Options dialog box appears.

Figure 70 -- Find Usages/Dependent Elements Options

Element Name Treat relationships as search result

Function Search results provide the complete list of used or dependent relationships together with other results.

Treat model elements at Relationships are skipped and displays only the end of relationships as usages/dependent elements between model elements that search results are connected with these relationships.

4-147

2005 No Magic, Inc.

DIAGRAMS BASICS Model Traceability

Element Name List usages/dependent elements of every child element

Function Usages/dependencies of inner elements (beneath the level of current element) are listed in the search results list. When the List usages/dependent elements of every child element check box is cleared (default value), in the usages/dependencies tables, are listed those elements that are using the current element. For example: element1, contains element2. Search not recursively. Elements, which use element1 are listed. Search recursively. Elements, which use element1 are listed, and in other branch, are listed elements, which uses element2. Only usages/dependencies outside the current element (above the level of current element and in the same level) are listed. You may use this option when exporting package as modules. You may analyze dependencies of package inner element to the outer elements (you may not export package, if it has inner elements with dependencies to outer elements according to this package). For example: Create package p1 and package p2. Connect these packages with dependency relationship. In the Browser, drag and drop dependency to the p1. In the Find Usages / Dependent Elements Options dialog box, select the Ignore inner relations check box. Search for the p1 dependency. Dependency to the dependency relationship is not found, because this element is child of p1. If you want to see new Elements Using / Dependencies windows for every new search, select the Show results in the new tab check box. If the Show this dialog before searching check box is selected, every time you will search for usages/dependencies the Find Usages / Dependent Elements Options dialog box will appear. If the Show this dialog before searching check box is cleared, you may invoke the Find Usages / Dependent Elements Options dialog box, from the Elements Using/Dependencies windows, by pressing the Show Usages / Dependent Elements Options button.

Ignore inner relations

Show results in the new tab Show this dialog before searching

ELEMENTS USING \ DEPENDENCIES WINDOWS In the Elements Using / Dependencies windows are listed results of the usages / dependencies. In the Elements Using / Dependencies windows you may analyze results, search for elements place (in diagram, in browser), filter results.

To open the Elements Using / Dependencies off windows:


1 Select a model element in the Browser tree or on the diagram pane. 2 Choose the Related Elements command from the shortcut menu and then Find

Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements dialog box appears. Click OK.
2005 No Magic, Inc

4-148

DIAGRAMS BASICS Model Traceability

4 The Elements Using / Dependencies window is opened.

Figure 71 -- Elements using/ Dependences off window

More information about the Elements Using /Dependencies window, is written in the table bellow.
Item Name Expand Collapse Select in Containment Tree Function Expand records listed in groups. Adequate action is next to the group name to click on the cross. Collapse records listed in groups. In the usages / dependencies table, select the record. Click on the Select in Containment Tree button. Element is select in the Browser, Containment tree and symbol on this element is selected on the diagram pane. Press the Select in Containment Tree button, closed and not loaded diagrams are opened. Element is selected in the Containment Tree after double click too. NOTE Select in Containment Tree button is not available for multiple elements selections. In the usages / dependencies table, select the record. Click on the Move to Search Results button. In the usages/dependencies tables listed results, are moved to the Browser, Search Results tree. In the Search Results tree, you may see all results in one list, grouped in two groups: From diagram and From model.

Move to Search Results

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

2005 No Magic, Inc.

DIAGRAMS BASICS Model Traceability

Refresh

The usages/dependencies tables should be refreshed after: elements or symbols are deleted, new dependencies/usages are created for the particular model element. The Find Usages / Dependent Elements Options dialog box is opened. In the Elements Using and Dependencies windows, Filter combo boxes are placed above the column which will be filtered. In the Elements Using window, filtering according to element type and usage type are available. In the Dependencies window, filtering according to element type and dependency type are available. Expand the Filter combo box, you will see items, listed in the appropriate usages / dependencies columns. NOTE In the Elements Using window, Element Type Filter combo box, additional Show All but Symbols filtering options is added.

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.

To add a hyperlink for the model element


1 Open the model element Specification dialog box and select the Hyperlinks tab. 2 Define the hyperlink to any model element, file, or web page in the Insert

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.

To set the note/text box/separator text as HTML


From the note/text box shortcut menu, choose HTML Text. Draw note or text box, using the Note (HTML text) or Text Box (HTML text) toolbar buttons.

When selecting the text, the HTML editor toolbar appears.

To add a hyperlink to a note, text box, or separator text

2005 No Magic, Inc

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

a web page, another model element, or a file: To link to an existing model element, click the Element/Symbol tab, then click the Select Element/Symbol button and select the model element or symbol you want to link to in the Select Model Element dialog box.

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

Set the path of the HTML viewer in the Environment Options dialog box (for a description, see Section Setting Personal Preferences on page 2-24.)

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

NOTES:

selected file will be opened in the HTML browser.

the path of the HTML viewer in the Environment Options dialog box.
You

may link only to an existing file. New files will not be created for you. Using the HTML editor toolbar, you may change the font, color, size, and the alignment of the selected text. INSERT HYPERLINK
DIALOG BOX

To open the Insert Hyperlink dialog box


1 Create a text box or a note on a diagram pane. Type the text you need. Set the

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

2005 No Magic, Inc.

DIAGRAMS BASICS Model Traceability

3 Select the text where you want to add hyperlink and click the Insert Hyperlink

button.

Figure 72 -- Insert Hyperlink dialog box

Tab name Element/ Symbol Creates a hyperlink that goes to the selected model element.

Box Text to display Select Element / Symbol Select from list Clear Active

Function A text that will be displayed as a hyperlink. The Select Model Element dialog box appears. Select the model element you want to link to. A list of items that have ever been selected as a link. Removes all items from the Select from list list. If selected, activates the hyperlink on the diagram. A text that will be displayed as a hyperlink.

Web Page Creates a hyperlink that goes to the specified Web page.

Text to display

Type the Web Page name

Type the web page url. Click the button. The Web browser window appears. Browse the web and find the web page you want to link to. NOTE Make sure that the path of a HTML viewer is set in the Environment Options dialog box.

2005 No Magic, Inc

4-152

DIAGRAMS BASICS Laying out

Tab name

Box Select from list Clear

Function A list of items that have ever been selected as a link. Removes all items from the Select from list list. A text that will be displayed as a hyperlink. Type the path to the file you want to be opened or click the ... button. The Open dialog box appears. Select the file you want to link to. A list of items that have ever been selected as a link. Removes all items from the Select from list list.

File Creates a hyperlink that goes to the specified file.

Text to display Type the file name

Select from list Clear

Buttons available in the Insert Hyperlink dialog box:


OK. Saves changes and exits the dialog box. Cancel. Exits the dialog box without saving changes. Help. Displays MagicDraw Help

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.

To resize the selected shape


Drag the corner of the shape to the desired size.

To resize automatically the selected shape to preferred size


From the shape shortcut menu, choose Autosize.

To alter the routing of the path line


Drag any point of the selected path in any direction. Magic Draw layouting mechanism is built on various layouters. All Layouters could be separated into 2 different groups: general layouters and specific diagram layouters. MagicDraw has only one specific diagram layouter - Class Diagram Layouter. General layouters are:

Orthogonal Layouter
2005 No Magic, Inc.

4-153

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 Use Existing Drawing as Sketch Values boolean Default Value false Description The layouter tries to "orthogonalize" the given sketch by interpreting it and without making too many modifications in respect to the original drawing. Keeps the relative position of symbols inside packages and performs the top level layout. Set the desired layout quality. Higher values result in less connection crossings and smaller layout area, but also increased computation time. Defines the virtual grid spacing used by the layouter. Each shape center point lies on a grid point.

Layout Only Top Boolean Level Symbols Group Layout Quality 0-1

False

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

2005 No Magic, Inc

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 Default Value Description True 40 30 If True, orientation is reversed in activity diagram. Determines the minimal distance between shapes that reside in adjacent layers. Determines the minimal distance between adjacent shapes that reside in the same layer. Determines the distance between adjacent pairs of horizontal path segments and between horizontal path segments and shapes. Determines the minimal length of the first and last segments for orthogonal path routings, i.e. the length from the intersection points to the first or last bend point respectively. Determines main layout orientation. Reverse Boolean Orientation in Activity Diagram Minimal Layer Distance Minimal Shape Distance Minimal Path Distance Integer Integer

Integer

30

Minimal First Segment Length

Integer

10

Orientation

Top to Bottom, Bottom to Top, Left to Right, Right to Left Linear Segments, Polyline, Simplex, Pendulum, Median Simplex, Tree

Top to Bottom

Shape Placement

Simplex

Linear Segments. Aligns shapes in such a way that path segments tend to have very few bends. It is a very good choice in combination with Path Routing set to Orthogonal. However this greatly increases layout width. Polyline. Aligns shapes by slightly reducing the width without shape overlaps. Although paths will have lots of bends. Pendulum. A sound combination of Linear Segments and Polyline. Simplex. Produces high quality drawings. Similar to Linear Segments, aligns shapes in such a way that path segments tend to have very few bends. Additionally, the resulting layout will be more balanced and more compact. Median Simplex. It tends to produce more locally symmetric layouts for the sake of a few more bends. Tree. Produces very nice layouts, when the graph is a tree. If the graph is not a tree, the placement policy Linear Segments will be used.

4-155

2005 No Magic, Inc.

DIAGRAMS BASICS Laying out

Option Path Routing

Values

Default Value Description


Oblique, Orthogonal Orthogonal

Oblique. Paths are routed to oblique style with a certain number of bends. Orthogonal. Paths are routed to orthogonal style. Orthogonal path routing increases the height of the layout.

Randomization Rounds

Integer

40

Determines the number of rounds that are initialized using different randomized starting positions. Greater values can lead to fewer crossings and longer running times. Huge diagrams with lots of inherent crossings should be processed using smaller values. Keeps the relative position of symbols inside packages and performs the layout only on the top level. Inheritance paths are joined into inheritance arcs.

Layout Only Top Boolean Level Symbols Make Sub Trees Boolean

False

True

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 Layout Style Values Directed, Balloon, HorizontalVertical Default Value Description Directed

Directed. The tree is laid out hierarchically with the root shape on the top. This is a good choice for directed trees with a unique root shape and a moderate number of shapes on a single hierarchy level. This layout style uses current diagram layout as a sketch to determine the order of siblings at a common shape. Balloon. The tree is routed in a radial style. This is a good choice for undirected, dense, or huge trees with a high number of shapes on a single hierarchy level. Horizontal-Vertical. Children of a shape are either arranged on a horizontal or on a vertical line. Paths are routed orthogonally. This layout can be very compact if you choose the right alignment type for children of a node.

2005 No Magic, Inc

4-156

DIAGRAMS BASICS Laying out

Option Make Sub Trees Directed Minimal Layer Distance Minimal Shape Distance Orientation

Values Boolean

Default Value Description True Inheritance paths are joined into inheritance arcs. Determines the minimal distance between parent and child shapes. Determines the minimal distance between siblings of a shape. Determines the main layout orientation. The layouter tries to arrange shapes in such a way that all paths point in the main layout direction. Determines the way how paths are attached to shapes. Border Centered. Paths are attached to the center of the border of corresponding shapes. Border Distributed. Path attachment points are distributed along the border of corresponding shapes. If selected, all paths are routed orthogonally in a bus-like fashion. If not selected, paths are routed as straight line segments.

Integer Integer

50 50

Top to Bottom, Top to Bottom to Top, bottom Left to Right, Left to Right Border Centered, Border Distributed Border Centered

Port Style

Orthogonal Path Boolean Routing

True

Balloon Root Shape Position Directed Root, Center Root Center Root Directed Root. Chooses a shape with indegree zero if present. A good choice for directed rooted trees. Center Root. Chooses the root shape in such a way that the depth of the resulting tree is minimized.

Preferred Child Wedge

0-360

340

Determines the angular range of the sector that will be reserved for children of a shape. The remaining angular range will be automatically used to accommodate the edge that connects to the root node. Determines the angular range of the sector that will be reserved around the root shape to accommodate attached subtrees. Determines the minimal length of a path. The smaller the compactness factor, the shorter paths and more compact overall layout.

Preferred Root Wedge

0-360

360

Minimal Path Length Compactness Factor Horizontal-Vertical

Integer 0.1-0.9

50 0.5

4-157

2005 No Magic, Inc.

DIAGRAMS BASICS Laying out

Option Horizontal Spacing Vertical Spacing

Values Integer integer

Default Value Description 20 20 The minimal horizontal distance between adjacent shapes. The minimal vertical distance between adjacent shapes.

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 Preferred Path Length Values Integer Default Value Description 50 Specify the preferred length of all paths. The layouter tries to arrange the shapes in such a way that paths have the determined path length. If True, the distance between two shapes is calculated with respect to shapes' size. Regulates the tendency of the shapes to be placed near the center of the diagram. The greater factor is, the closer shapes are placed to the center of diagram. Negative values lead to huge layouts. Higher values makes Layouter obey the given preferred path length. Higher values result in greater shape distances. If True, optimizes tree-like substructures of the diagram. Optimization process might ignore some layout options. If True, the algorithm keeps the relative position of symbols inside of packages and performs the layout only on the top level. Control the compactness of package shape. Larger values lead to more compact package shapes but paths between packages may be longer and shapes inside packages tend to get clutched together at the center of the package.

Obey Shape Size Gravity Factor

Boolean

True

-0.2-2

Path Attraction

0-2

2 0 True

Shape Repulsion 0-2 Activate Tree Beautifier Boolean

Layout Only Top Boolean Level Symbols

False

Package Shape Compactness

0-1

0.2

2005 No Magic, Inc

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 Layout Style Values Compact, Isolated, Single Cycle Default Value Compact Description

Compact. Each group will consist of shapes that are reachable by two link disjoint paths. Shapes that belong to more than one group will be assigned exclusively to one group. Isolated. Each group will consist of shapes that are reachable by two path disjoint paths. All shapes belonging to more than one group will be assigned to an isolated group. Single Cycle. All shapes will be arranged on a single circle.

Minimal Shape Distance

Integer

100

Determines the minimal distance between borders of two adjacent shapes on a common circle. The smaller the distance, the more compact resulting layout. If True, determines the radius of each circle in the layout automatically. An automatically chosen radius is usually the smallest possible radius that obeys Minimal Node Distance. If Auto Circle Radius is not set, this option determines the fixed radius for all circles in the resulting layout. Minimal Node Distance will be ignored in this case. Determines the angular range of the sector that will be reserved for children of a shape. The remaining angular range will be automatically used to accommodate the paths that connect to the root node.

Auto Circle Radius

Boolean

True

Fixed Circle Radius

Integer

200

Preferred Child Wedge

0-360

340

4-159

2005 No Magic, Inc.

DIAGRAMS BASICS Laying out

Option Minimal Path Length

Values Integer

Default Value 50

Description Determines the minimal length of a path that connects two shapes that lie on separate circles. The smaller the chosen value, the more compact the resulting layout. The bigger the chosen value, the more compact the resulting layout. If a value smaller than 90 degrees, the tree-edges might cross through the circularly arranged groups of shapes. The smaller the compactness factor, the shorter paths and the more compact the overall layout.

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 Minimal Distance Use Existing Bends Route Only Necessary Values Integer Boolean Default Value 20 False Description Specifies the minimal allowed distance between shapes and paths. Specifies whether existing bends should be used as an initial solution for the new routing. If True, only paths that violate the minimal distance criterion will be rerouted.

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.

2005 No Magic, Inc

4-160

DIAGRAMS BASICS Laying out

Organic Path layout options


Option Minimum Path Distance Custom Minimum Distance to Nodes Route on Grid Space Driven Vs. Center Driven Search Values Integer Integer Default Value 1 10 Description Determines the minimum distance between any two path segments. Determines the distance between any path segment and any shape side. The path router strictly adheres to the set value. Router doesn't use this value by default due to increased calculation times. If True, all paths are routed on grid lines from the predefined grid. Determines the ratio between two complementary weighting strategies when looking for a path, namely "center driven" and "space driven" weighting. Values closer to 0 lead to paths that are more distributed over the available space. Values closer to 1 give more emphasis to paths closer to a path's center. If False, the number of crossings seen at a shape side can increase a lot. Since this option has a positive effect on a diagram "readability," it is enabled by default.

Boolean True 0-1 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 Minimal Layer Distance Minimal Shape Distance Orientation Values Integer Integer Top to Bottom, Bottom to Top, Left to Right, Left to Right Default Value 50 50 Top to bottom Description Determines the minimal distance between parent and child shapes. Determines the minimal distance between the siblings of a shape. Determines the main layout orientation. The layouter tries to arrange shapes in such a way that all paths point in the main layout direction.

4-161

2005 No Magic, Inc.

DIAGRAMS BASICS Zooming

Option Compactness Factor

Values 0-1

Default Value 1

Description Adjusting this value can lead to a variety of differing layouts. For small values, the resulting layout will use much space and shapes tend to be far away from each other. Values around 0.5 lead to evenly distributed shapes, whereas values near 1.0 produce highly compact layouts Determines the ratio between two complementary weighting strategies when looking for a path, namely "center driven" and "space driven" weighting. Values closer to 0 lead to paths that are more distributed over the available space. Values closes to 1 give more emphasis to path paths closer to a path's center. Classes connected by generalization paths are organized into hierarchies Classes connected by realization paths are organized into hierarchies Classes connected by containment paths are organized into hierarchies If enabled, inheritance paths will be joined into inheritance arcs.

Space Driven Vs. Center Driven Search

0-1

Build Generalization Hierarchies

Boolean

True False False True

Build Realization Boolean Hierarchies Build Containment Hierarchies Make Sub Trees Boolean Boolean

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.

To fit the current diagram in the window

From the View menu or from the diagram shortcut menu, choose Fit in Window (shortcut keys CTRL+W.) Click the Fit in Window button in the Browser, Zoom tab.

2005 No Magic, Inc

4-162

DIAGRAMS BASICS Using Grid

To zoom the current diagram in

From the View menu or from the diagram shortcut menu, choose Zoom In (shortcut keys CTRL+NumPad PLUS SIGN (+) or scroll.) Click the Zoom In toolbar button .

To zoom the current diagram out

From the View menu or from the diagram shortcut menu, choose Zoom Out (shortcut keys CTRL+NumPad MINUS SIGN (-) or scroll.) Click the Zoom Out toolbar button .

TIP!

You may zoom in or zoom out using the CTRL+wheel keys.

To restore the diagrams original size

From the View menu or from the diagram shortcut menu, choose Zoom 1:1 (shortcut keys CTRL+NumPad SLASH MARK (/).) Click the Zoom 1:1 toolbar button .

To view selected shapes at maximum size


Select shapes and then, from either the View menu or the diagram shortcut menu, choose Zoom to Selection (shortcut keys CTRL+NumPad ASTERICS 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

2005 No Magic, Inc.

DIAGRAMS BASICS Assigning Shortcut Keys

To change the grid state (visible, not visible)


From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Show Grid check box.

To pull a path with the intersection of gridlines


From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Snap Paths to Grid check box.

To pull a shape with the intersection of gridlines


From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Snap Shapes to Grid check box.

To change the grid size


1 From either the View menu or from the diagram shortcut menu, choose Grid

and then choose Grid Size . 2 The Grid Size dialog box appears. 3 Enter a grid size between 2 and 30 (default is 10). 4 Click OK.

To change the grid style


1 From the Options menu, choose Environment. The Environment Options dialog

box appears. 2 From the Grid Style drop-down list box, select one of the following style of the grid: Dense

Sparse (default)

ASSIGNING SHORTCUT KEYS


To assign or change the shortcut key of the command
1 From the Options menu, choose Environment. 2 The Environment Options dialog box appears. 3 Choose the Keyboard pane and assign the desired shortcut keys in the right

pane of the dialog box. For more information about Keyboard pane Section Keyboard pane on page 2-36.

2005 No Magic, Inc

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.

To open the Print dialog box

Choose the Print command from the File menu. In the Print Preview screen, click the 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

2005 No Magic, Inc.

DIAGRAMS BASICS Printing

Figure 73 -- Print dialog box. Print Range tab

Element name Active Diagram Selected Symbols Selected Diagrams Name

Function Prints currently opened diagram. Prints symbols you select on the diagram. The desired symbols should be selected to activate this option button. From the Not Empty Diagrams list, select diagrams you want to print. Shows available diagrams in the project. To select the diagram for printing, click the name of the diagram in the list. The selected diagrams are highlighted. Press CTRL or SHIFT to select more than one diagram. The name of the model element that owns the particular diagram. Selects all the diagrams in the list for printing. Removes the selection. Loads all diagrams of the project. By default only opened diagrams are shown in the Print dialog box. Prints the selected diagram(s). Closes the dialog box. Displays MagicDraw UML Help.

Owner Select All Unselect All Load All Diagrams Print Close Help

2005 No Magic, Inc

4-166

DIAGRAMS BASICS Printing

PRINT OPTIONS TAB Click the Print Options tab to customize the printing jobs.

Figure 74 -- Print dialog box. Print Options tab

Element name Print Background Show Pages on Diagram Fit in Page

Function Prints the background color of your diagrams. Shows the page boundary on the diagram pane. NOTE You will not see any boundary if the Fit in Page check box is selected. 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 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. Set the number of pages you want to printed a diagram on. Vertical. The number of vertical pages the diagram will be displayed on. Horizontal. The number of horizontal pages the diagram will be displayed on. The standard, according to your application, the Page Setup dialog box appears.

Zoom

Pages

Page Settings

4-167

2005 No Magic, Inc.

DIAGRAMS BASICS Printing

Element name Print Test Page Preview < >

Function Print the test page. Set print options in the Print Options dialog box. Preview your diagrams appearance before printing. Preview the previous page. Preview the next page.

PRINT HEADER/FOOTER TAB Click the Print Header/Footer tab to customize header and footer of the printed pages.

Figure 75 -- Print dialog box. Print Header/Footer tab

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.

2005 No Magic, Inc

4-168

DIAGRAMS BASICS Model Elements Common in all Diagrams

MODEL ELEMENTS COMMON IN ALL DIAGRAMS


The following symbols are only graphical symbols and do not possess data.
Model elements Text Box (X) Button Function
Type text directly on the diagram.

Notation

Text Box (HTML text)

(SHIFT+X) Note (N) Note (HTML text) (SHIFT+N) Note Anchor


Relates symbols and notes. 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. The presentation of a constraint between two graphical symbols. A graphical symbol containing textual information. Use a note to add any needed information to your diagram. Usually a note is connected with another symbol, using a note anchor line.

(H)

Constraint NOTE To select a constraint, right-click the Note Anchor button. Separator (W) (SHIFT+H)

Separates different parts of a diagram with a horizontal line.

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

2005 No Magic, Inc.

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.

To add a constraint expression to the constraint path


From the constraint path shortcut menu, choose Select Constraint and select one of the following:

Choose <new>. The Constraint Specification dialog box appears. Fill in the dialog box. Choose an already created constraint from the list. 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.

To set the text position of the name of a separator

From the separator shortcut menu, choose Text Position, and then choose the text position you need: Left (default), Center, or Right. Set a text position in the Project Options dialog box.

To set a separator line style (dashed or solid)

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

To open the Comment Specification dialog box


In the elements Specification dialog box, click the Documentation button.

To display the documentation on the Diagram pane


1 Draw a note on the Diagram pane. 2 Using a note anchor, connect a note with the model element which contains the

TIP!

documentation you want to be displayed. 3 From the note shortcut menu, choose Retrieve Documentation. If a comment contains stereotypes, tagged values, and/or constraints, you may choose to display them in the notes content.

4-171

2005 No Magic, Inc.

DIAGRAMS BASICS Model Elements Common in all Diagrams

2005 No Magic, Inc

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:

Functional (static structure and dynamic interactions) Nonfunctional (timing requirements, reliability, and deployment) Organizational (work organization and mapping to code modules) Class diagram Object diagram Use case diagram Statechart diagram Activity diagram Collaboration diagram Sequence diagram Component diagram Deployment diagram

MagicDraw supports all diagrams defined in UML 1.4:


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.

2005 No Magic, Inc.

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:

Figure 76 -- System Views

Several kinds of diagrams provide a visual notation for the concepts in each view.

Use Case View


The use case view represents the functionality and behavior of a system, subsystem or a class as it is perceived by external users. This view is targeted mainly to customers, designers, developers, and testers. The use case view usually is presented as a number of use cases and actors in Use Case diagrams. Occasionally it is used in Activity and Sequence diagrams. The use case view is central because its contents drive the development of the other views. It is also used for the project planning. Every single use case unit is deemed as the manageable unit during a projects execution.

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

2005 No Magic, Inc.

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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Class diagram elements


Model element Class A descriptor for a set of objects with similar structures, behaviors, and relationships. Button (hot key) Notation

(C)

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.

(K)

(I)

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. Package A group of classes and other model elements.

(Shift_F11)

(P)

2005 No Magic, Inc

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.

Button (hot key)

Notation

(Y)

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).

(M)

(O)

5-179

2005 No Magic, Inc.

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. Object An instance of a class.

Button (hot key)

Notation

(Q)

(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.

(S)

(A)

Composition A composition is a form of aggregation with stronger ownership and coincident lifetime of part with the whole.

(F)

2005 No Magic, Inc

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.

Button (hot key)

Notation

(SHIFT+C)

(G)

Realization (realize) A relationship usually used between an interface and implementation class.

(R)

Realization Relationship between class and interface. (E)

5-181

2005 No Magic, Inc.

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)

2005 No Magic, Inc

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

Figure 77 -- Class Specification dialog box

5-183

2005 No Magic, Inc.

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 Set class visibility, which defines class access level. Public. The class can be accessed by any outside object. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use this class. Private. The class can be accessed only from inside the current class. Protected. The class can be accessed from inside the current class and classes derived from that class. Defines a class as active. The name of the template parameter. Type of the template parameter: other classifier or data type. Set your own value or select a model element in the Select Model Element dialog box. The Template Parameter Specification dialog box appears. Edit the parameter. The Template Parameter Specification dialog box appears. Define the parameter. Remove the selected template parameter from the class. Model element type and name. The corresponding (class, use case, data type, interface, collaboration) specification dialog box appears. Edit the selected model element in the dialog box. The corresponding (class, use case, interface, collaboration) specification dialog box appears. Define the selected model element in the dialog box. Remove the selected model element from the class. Name of the port. Class, assigned to port as a type. The Port Specification dialog box appears. Define the port options in the dialog box. Port is removed from class. General Visibility Set general information about the class

Active Template Parameters A template is the descriptor for a class with one or more unbound formal parameters. Name Type Default Value Edit Add Remove Inner Elements Name Add another class, Edit use case, interface, or/and collaboration to a class Add

Remove Ports Default Name Type Edit Remove

2005 No Magic, Inc

5-184

UML DIAGRAMS Class Diagram

To insert an inner element in the selected class


1 Double-click the selected class or choose Specification from the class shortcut

menu. The Class Specification dialog box appears. 2 Click the Inner Elements tab and then click the Add button. Choose the element (class, use case or interface) you wish to add from the list. 3 Click the selected element. 4 The Class Specification / Use Case Specification / Enumeration Specification / Interface Specification / Data Type Specification / Primitive Specification / Programming Language Data Type Specification / Collaboration Specification dialog box appears. Define the class, use case or interface and click OK.

To show an inner element on the diagram


1 Select a created inner element in the Browser. 2 From the element shortcut menu, choose Create Symbol.

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.

To control a list of operations and attributes that are visible on a diagram


Choose Edit Compartment from class shortcut menu. The Compartment Edit dialog box appears. For a detailed descriptions, see Section Submit a Bug dialog box on page 9-470. A class can be defined as active (a border to the class shape is added). An active class specifies whether an object of the class maintains its own thread of control. A class is a generalizable element and can be defined as Abstract, Leaf, or Root.

To define class as abstract, leaf, root and/or active


1 Double-click the selected class or choose Specification from the class shortcut

menu. The Class Specification dialog box appears. 2 Select the Abstract, Leaf, Root, and/or Active check box in the General tab.

5-185

2005 No Magic, Inc.

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.

2005 No Magic, Inc

5-186

UML DIAGRAMS Class Diagram

Interface Specification dialog box

Figure 78 -- Interface Specification dialog box

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 Function

General Visibility Set general information about the interface

Public. The interface can be accessed by any outside model element. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that interface. Private. Only the interface itself, or elements nested within that interface can see it. Protected. Classifiers derived from that interface may see it.

Template Parameters A template is the descriptor for an interface with one or more unbound formal parameters.

Name Type Default Value Edit Add Remove

The name of the template parameter. Type of the template parameter: other interface or data type. Set your own value or select a model element in the Select Model Element dialog box. The Template Parameter Specification dialog box appears. Edit the parameter. The Template Parameter Specification dialog box appears. Define the parameter. Remove the selected template parameter from the interface.

5-187

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Tab name

Box name

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.

Inner Elements Name Add class, use Edit case, interface, enumeration, data type, programming language data type or/and Add collaboration to an interface

Remove

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.

To create a new attribute

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.

Define an attribute in the Attribute Specification dialog box.

To open the Attribute Specification dialog


1 Open the Class Specification, Actor Specification, or Interface Specification

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.

Double-click the desired attribute directly on the diagram.

2005 No Magic, Inc

5-188

UML DIAGRAMS Class Diagram

Attribute Specification dialog box

Figure 79 -- Attribute Specification dialog box

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 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. Additional information about the type. & - one class has a reference to other model element. * - one class has a pointer to other model element. [] - one class has an array of other model elements. 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.

General Class Set general information for the Type attribute

Type Modifier

Changeability

5-189

UML DIAGRAMS Class Diagram

Tab name

Options Initial value Multiplicity

Function Type the initial value for the current attribute. The possible number of data values for the attribute that can be held by an instance. The cardinality of the set of values is an implicit part of the attribute. In the common case in which the multiplicity is 1..1, then the attribute is a scalar (i.e., it holds exactly one value). 0 zero and only zero. 1 one and only one. 0..1 zero or one. 0..* - from zero to any positive integer. 1..* - from one to any positive integer. * - any positive integer. Set attributes visibility, which defines attributes access level. Public. The attribute can be accessed by any outside object. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use this attribute. Private. The attribute can be accessed only from inside the current class. Protected. The attribute can be accessed from inside the current class and classes derived from that class. Specifies whether the targets are ordinary Instances or are Classifiers Instance. Each value contains a reference to an Instance of the target Classifier. This is the setting for a normal Attribute. Classifier. Each value contains a reference to the target Classifier itself. This represents a way to store metainformation.

Visibility

Scope

To create a link attribute


1 Draw an association between two classes (for example A and B). 2 On the Diagram pane, place the third class (C). 3 Click the Link Attribute button and draw a dashed line from C to an association

2005 No Magic, Inc

5-190

UML DIAGRAMS Class Diagram

If an attributes type is another model class, this attribute can be represented as an association with a role (attribute name) between owner class and class of attribute type
Choose Create Roles from the class shortcut menu. A list of available attributes appears. Choose one and an association relationship with a role is created.
NOTE

This command is visible only if one or more attribute types are other model classes.

To change an attribute name


Attribute name must be unique in the class scope.
1 Click the attribute in the selected class on the diagram pane or in the Browser

tree. 2 Type a new name. Change an attribute name in the Attribute Specification dialog box.

To define the type of an attribute


Attribute type can be other class, interface, or a primitive class, such as int or double.

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.

TIP:

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.

To add additional information about the type of an attribute


1 Open the Attribute Specification dialog box. 2 Choose a sign in the Type Modifier drop-down list box:

& - one class has a reference to other model element. * - one class has a pointer to other model element. [] - one class has an array of other model elements.

5-191

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

To set an attribute visibility


Visibility Name Public + Package ~ Protected # Private -

Function an attribute can be accessed by any other element. an attribute can be accessed by element from the same package. an attribute can be accessed from the inside of the selected class and classes derived from that class. an attribute can be accessed only from inside of that class.

Type +, ~, -, or # visibility marks just before an attribute name directly on a diagram.

1 Open the Attribute Specification dialog box. 2 From the Visibility drop-down list box, choose the desired item (public, package, NOTE

protected, and private.) Attribute visibility is shown at the attribute signature.

To set an attribute scope


1 Open the Attribute Specification dialog box. 2 From the Scope drop-down list box, choose the desired item (Instance or

Classifier.)

To set an attribute multiplicity


1 Open the Attribute Specification dialog box (see above). 2 Choose or set a multiplicity value in the Multiplicity drop-down box.

To set attribute changeability


The attribute changeability controls the access by operations on the class on the opposite end.
Name changeable frozen Function No restrictions on modification. 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. 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.

addOnly

Choose changeable, frozen, or addOnly from the drop-down list box in the Attribute Specification dialog box.

2005 No Magic, Inc

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.

To create a new 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.

Define an operation in the Operation Specification dialog box.

To open the Operation Specification dialog box


1 Double-click the class /actor/subsystem or choose Specification from the

classs/actors shortcut menu. The Class Specification / Actor Specification / Subsystem Specification dialog box appears. 2 Click the Operations tab. 3 Click the Add or Edit button. The Operation Specification dialog box appears. Double-click an operation.

5-193

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Operation Specification dialog box

Figure 80 -- Operation Specification dialog box

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 General Set general information for the operation Box Class Function Shows a class, which contains the current operation. You may not change the value of the Class box. It is automatically defined when you create an operation. Shows operations type. It can be another project class or primitive type such as int or double. Choose the type from the list or add a new one by clicking the New button. Additional information about the return type. & - one class has a reference to other model element. * - one class has a pointer to other model element. [] - one class has an array of other model elements. Set operations concurrency: sequential, guarded, concurrent. If selected, the operation is set as query. An operation that returns a value but does not alter the state of the system; an operation without side effects.

Return Type

Return Type Modifier

Concurrency Query

2005 No Magic, Inc

5-194

UML DIAGRAMS Class Diagram

Tab name

Box Visibility

Function Set operations visibility, which defines operations access level. Public. The operation can be accessed by any outside object. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that operation. Private. The operation can be accessed only from inside the current class. Protected. The operation can be accessed from inside the current class and classes derived from that class. Specifies whether the operation is an instance or a classifier. Instance. An instance value is part of each link. This is the default. Classifier. A classifier itself is part of each link. Normally this would be fixed at modeling time and need not be stored separately at run time. Shows the parameters name. Shows the parameters type. It can be a classifier or a data type. An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter. Specifies what kind of a parameter is required: in - an input parameter (may not be modified). out - an output parameter (can be modified to communicate information to the caller). inOut - an input parameter that can be modified. Move up the list Move down the list. The Parameter Specification dialog box appears. The Parameter Specification dialog box appears. Removes the parameter.

Scope

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

To change an operation name


1 Click the operation in the selected class on the diagram pane or in the Browser

tree. 2 Type a new name. Change an operation name in the Operation Specification dialog box.

To define the return type of an operation

In the Attribute Specification dialog box, the Return Type drop-down list box, choose the return type of an operation .

5-195

2005 No Magic, Inc.

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.

To edit / add operation parameter


1 Open the Operation Specification dialog box. 2 Click the Parameters tab. 3 Double-click the desired parameter in the list of operation parameters or select

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.

Parameter Specification dialog box The Parameter Specification dialog box defines operations argument.

To open the Parameter Specification dialog box


1 Open the Operation Specification dialog box. 2 Click the Parameters tab, and then double-click the desired parameter. Or click

the Add /Edit button.

Figure 81 -- Parameter Specification dialog box

2005 No Magic, Inc

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 The name of the operation, which contains the parameter. Shows the parameters type. It can be a classifier or a data type. Choose a type from the list or create a new one by clicking the New button. Additional information about the type. & - a parameter is a reference to other model element. * - a parameter is a pointer to other model element. [] - a parameter is a an array of other model elements. An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter. Select the direction kind: in - an input parameter (may not be modified). out - an output parameter (can be modified to communicate information to the caller). InOut - an input parameter that can be modified. General Operation Set general information about Type the parameter Type Modifier

Default Value

Direction kind

To add additional information about the return type of an operation


1 Open the Operation Specification dialog box. 2 Choose a sign from the Return Type Modifier drop-down list box:

& - one class has a reference to other model element. * - one class has a pointer to other model element. [] - one class has an array of other model elements.

Operation can be defined as:


Name Abstract Leaf Root Function The operation does not have an implementation, and one must be supplied by a descendant. The implementation of the operation may not be overridden by a descendant class. The class must not inherit a declaration of the same operation.

To define an operation as abstract, leaf, or root


1 Open the Operation Specification dialog box. 2 Select the Abstract, Leaf, and/or Root check box(es) in the General tab.

5-197

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

To set an operation visibility


Visibility name Public + Package ~ Private - Protected # Function Operation can be accessed by any other object from outside. Operation can be accessed by element from the same package. Operation can be accessed only from that class. Operation can be accessed from inside that class and the classes derived from that class.

1 Open the Operation Specification dialog box. 2 From the Visibility drop-down list box, choose Public, Package, Private, or NOTE

Protected. Operation visibility is shown in the operation signature.

To set an operation scope


1 Open the Operation Specification dialog box. 2 From the Scope drop-down list box, choose Instance or Classifier.

To set an operation as query


Select the Query check box in the Operation Specification dialog box.

To set an operations Concurrency: sequential, guarded or concurrent


Name Sequential Function Callers must coordinate so that only one call to an Instance (on any sequential Operation) can be outstanding at once. If simultaneous calls occur, then the semantics and integrity of the system may not be guaranteed. Multiple calls from concurrent threads may occur simultaneously to one Instance (on any guarded Operation), but only one is allowed to commence. The others are blocked until the performance of the first Operation is complete. It is the responsibility of the system designer to ensure that deadlocks do not occur due to simultaneous blocks. Guarded Operations must perform correctly (or block themselves) in the case of a simultaneous sequential Operation or guarded semantics may not be claimed. Multiple calls from concurrent threads may occur simultaneously to one Instance (on any concurrent Operation). All of them may proceed concurrently with correct semantics. Concurrent Operations must perform correctly in the case of a simultaneous sequential or guarded Operation or concurrent semantics may not be claimed.

Guarded

Concurrent

Choose the concurrency type in the Concurrency drop-down list box in the Operation Specification dialog box.
5-198

2005 No Magic, Inc

UML DIAGRAMS Class Diagram

TEMPLATE / PARAMETERIZED CLASS A template is the descriptor for a class with one or more unbound formal parameters. It defines a family of classes, each class specified by binding the parameters to actual values. Typically, the parameters represent attribute types; however, they may also represent integers, other types, or even operations. Attributes and operations within the template are defined in terms of the formal parameters, so they too become bound when the template itself is bound to actual values.

To define a parameterized class


1 Double-click the class shape or choose Specification from the class shape

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.

To open the Template Parameter Specification dialog box


In the Class Specification or Interface Specification dialog box, click the Template Parameters tab and then click the Add or Edit button. Template Parameter Specification dialog box

Figure 82 -- Template Parameter Specification dialog box

Tab name General Set general information about the template parameter

Box name Type

Function Specify the template parameters type. It can be a class or a primitive type. Choose the type fro the list or add a new one by clicking the New button.

Default Value

Type the default value for the template parameter. The Select Model Element dialog box appears. Select a classifier you wish to assign as a default value to the template parameter.

5-199

2005 No Magic, Inc.

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

Figure 83 -- Port Specification dialog box

2005 No Magic, Inc

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 General Set general information for the port Box Type Function Shows ports type. It can be another project class or interface. Choose the type from the list or add a new one by clicking the New button. The possible number of data values for the port that can be held by an instance. The cardinality of the set of values is an implicit part of the port. In the common case in which the multiplicity is 1..1, then the port is a scalar (i.e., it holds exactly one value). 0 zero and only zero. 1 one and only one. 0..1 zero or one. 0..* - from zero to any positive integer. 1..* - from one to any positive integer. * - any positive integer. Specifies whether requests arriving at this port are sent to the classifier behavior of this classifier. Such ports are referred to as behavior port. Any invocation of a behavioral feature targeted at a behavior port will be handled by the instance of the owning classifier itself, rather than by any instances that this classifier may contain. If Is Service check box is true, it indicates that this port is used to provide the published functionality of a classifier. If Is Service check box is false, this port is used to implement the classifier but is not part of the essential externally. Shows the name of required interface. Opens the Interface Specification dialog box. Shows the name of provided interface. Opens the Interface Specification dialog box.

Multiplicity

Is Behavior

Is Service

Provided Interfaces Name Edit Required Interfaces 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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

You may also create Enumeration, Primitive, and Programming Language data types.

To create a new data type, including Enumeration, Primitive, and Programming Language Data Type

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.

NOTE:

You may create an enumeration by clicking the Enumeration button from the class diagram toolbar:

To create symbol of the created data type


From the created data type shortcut menu in the Browser, choose Create Symbol command.

2005 No Magic, Inc

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 General Set general information about the data type Box Visibility Function

Public. The data type may be accessed by any outside model element. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that data type. Private. Only the data type itself, or elements nested within that data type can see it. Protected. Classifiers derived from that data type may see it.

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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Enumeration Specification dialog box

Figure 84 -- Enumeration 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 Visibility Set general information about the enumeration

Public. The enumeration may be accessed by any outside model element. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that enumeration. Private. Only the enumeration itself, or elements nested within that enumeration can see it. Protected. Classifiers derived from that enumeration may see it.

Enumeration Literals An enumeration literal defines an element of the run-time extension of an enumeration data type.

Name Edit Add Remove

The name of the enumeration literal. The Enumeration Literal Specification dialog box appears. Edit the enumeration literal. The Enumeration Literal Specification dialog box appears. Define the enumeration literal. Remove the selected enumeration literal from the enumeration.

To add an enumeration literal


An enumeration literal defines an element of the run-time extension of an Enumeration data type. It has no relevant substructure, that is, it is atomic.
1 Open the Enumeration Specification dialog box.

2005 No Magic, Inc

5-204

UML DIAGRAMS Class Diagram

2 In the Enumeration Literals tab, click Add button. 3 The Enumeration Literal Specification dialog box appears. Define an

enumeration literal. Choose Insert New Enumeration Literal command from the Enumeration shortcut menu.

To suppress enumeration literals


1 From the enumeration shortcut menu, choose Presentation Options. 2 Select the Suppress Enumeration Literals check box.

To open the Enumeration Literal Specification dialog box


1 Open the Enumeration Specification dialog box. 2 In the Enumeration Literals tab, double-click the desired literal in the list, or click

the Edit or Add button.

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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

To create the design pattern for the selected class


1 From the class shortcut menu, choose Tools, and then choose Apply Pattern.

The Pattern Wizard dialog box appears. 2 Select the design pattern you want to apply and choose the desired options. Click OK. Select class and choose Apply Pattern from the Tools menu.

For a detailed description of this dialog box, see Section Pattern Wizard on page 7-432.

Class presentation options


To organize class data on the class shape

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.

2005 No Magic, Inc

5-206

UML DIAGRAMS Class Diagram

Figure 85 -- Presentation Options submenu

Command

Function (when selected)

Show Operations Signature Shows operation signature (arguments, return value and etc). Show Full Classifier Type Show Initial Attribute Value Show Attributes Visibility Show Operations Visibility Suppress Attributes Suppress Operations Show all Members Shows the full track of the type of an attribute from the root package. Shows Initial attribute value. Shows attribute visibility (public, package, private, or protected). Shows operation visibility (public, package, private, or protected). Attributes compartment is suppressed. Operations compartment is suppressed. The default settings are restored and shows all attributes and operations.

Show Only Public Members Shows only public attributes and operations.

5-207

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Command Attributes Sort Mode By Name By Stereotype By Visibility No Sorting Operations Sort Mode By Name By Stereotypes By Visibility No Sorting Show More Sign For Attributes Show More Sign For Operations Show Stereotypes Show Constraints Show Tagged Values Show Owner

Function (when selected) Choose the sorting parameter: Sort attributes by name. Sort attributes by stereotype Sort attributes by visibility (public, package, private, or protected) No sorting is executed. Choose the sorting parameter: Sort operations by name. Sort operations by stereotype. Sort operations by visibility (public, package, private, or protected) No sorting is executed. Additional information sign '' in the class attributes list, when a portion of attributes are omitted by editing a class compartment. Additional information sign '' in the class operations list, when a portion of operations are omitted by editing a class compartment. Shows stereotypes on a class. Shows constraints on a class. Shows tagged values on a class. Shows the owner (package, subsystem, or model) name on a class.

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.

2005 No Magic, Inc

5-208

UML DIAGRAMS Class Diagram

Package Specification dialog box

Figure 86 -- Package 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 Inner Elements Add another model element or a diagram to a package Box name Name Edit Function The type and the name of the model element or diagram, assigned to a package. 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 corresponding diagram Specification dialog box appears. Edit the name of the selected diagram. The corresponding specification dialog box appears. Specify the selected model element in the dialog box. Or the corresponding diagram Specification dialog box appears. A new diagram is created. Remove the selected model element or diagram from the package.

Add

Remove

To add inner elements to the selected package


1 2 3 4

Open the Package Specification dialog box. Click the Inner Elements tab. Click the Add button, and then click the element you wish to add. If you select a class, use case, actor, interface, component, node, collaboration, subsystem, model, or package the corresponding Specification dialog box appears. If you select a diagram the Diagram Specification dialog box appears.

5-209

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

5 The inner elements data for the selected package is created.

To change package header (name, stereotypes, tagged values, and constraints) position

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.

To show the list of elements assigned to a package on the package shape


Choose Show Elements List from the package shortcut menu.

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.

2005 No Magic, Inc

5-210

UML DIAGRAMS Class Diagram

Subsystem Specification dialog box

Figure 87 -- Subsystem 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 General Set general information about the subsystem Box name Instantiable Function Sets a subsystem as instantiable. It means that there may be several system parts with the same definition otherwise a subsystem represents a unique part of the physical system. The string <<instantiable>> is added above subsystem name. The type and the name of the model element or diagram, assigned to a subsystem. The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model) specification dialog box appears. Edit the selected model element in the dialog box. Or the Diagram Specification of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. Define the selected diagram. The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model, subsystem) specification dialog box appears. Specify the selected model element in the dialog box. Or the Diagram Specification of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, state diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. A new diagram is created.

Inner Elements Name Add another model element or Edit a diagram to a subsystem

Add

5-211

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Tab name

Box name Remove

Function Remove the selected model element or diagram from the model.

Additional operations can be added to a subsystem. For more information about how to define operations, see Section Operation on page 5-193.

To add an operation to a subsystem


Choose Insert New Operation from the subsystem shortcut menu. Open the Subsystem Specification dialog box. Click the Operations tab. Click the Add button. The Operation Specification dialog box appears. Select a subsystem and press shortcut keys CTRL+ALT+O. From subsystem shortcut menu in the Browser, choose New Element and then choose Operation.

To show/hide operations on a subsystem


Clear/select Suppress Operations check box from the subsystem shortcut menu or in the subsystem Properties dialog box.

To show/hide operations visibility on a subsystem


Select/clear Show Operations Visibility check box from the subsystem shortcut menu or in the subsystems Properties dialog box.

To show/hide a subsystems owner (package of which owns the subsystem)


Select/clear Show Owner check box from the subsystems shortcut menu or in the subsystems Properties dialog box.

To show/hide realization/specification elements


Clear/select Suppress Realization/Specification Elements check box from the subsystems shortcut menu or in the subsystems Properties dialog box. If a subsystem is set as instantiable, there may be several system parts with the same definition, if not, the subsystem represents a unique part of the physical system.

To set a subsystem as instantiable elements


Select the Instantiable check box in the Subsystem Specification dialog box, General tab.

2005 No Magic, Inc

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

Figure 88 -- 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 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. Inner Elements Name Add other model Type elements and diagrams to a Edit model

5-213

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Tab name

Box Add

Function 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 Edit Name of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, state diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. A new diagram is created. Remove the selected model element or diagram from the model.

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

Figure 89 -- Collaboration Specification dialog box

2005 No Magic, Inc

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 The name of the model element that will represent a collaboration. Click the ... button, to open the Select Model Element dialog box. Select a model element that will represent a collaboration. The name of the classifier, which is assigned to the collaboration. The name of the classifier, to which classifier role is assigned. The Classifier Role Specification dialog box appears. Modify the classifier role. The Classifier Role Specification dialog box appears. Define a new classifier role that will be added. Remove the selected classifier role from the collaboration. The name of the instance, which is assigned to the collaboration. The name of the classifier, to which the instance is assigned. The Instance Specification dialog box appears. Modify the instance. The Instance Specification dialog box appears. Define a new instance that will be added. Remove the selected instance from the collaboration. 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 Add Remove Instances Contains the list of collaboration instances and buttons for managing this list. Name Assigned Classifiers Edit Add Remove

To assign a new classifier role to the collaboration

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.

NOTE

You may edit the assigned classifier role in the Collaboration Specification dialog box, Cllassifier Roles tab.

To assign a new instance to the collaboration

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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

You may edit the assigned instance in the Collaboration Specification dialog box, Instances tab.

To select a classifier or operation that a collaboration represents


1 Open the Collaboration Specification dialog box. 2 Click the button in the Represented field. 3 Select the model element in the Select Model Element dialog box.

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.

2005 No Magic, Inc

5-216

UML DIAGRAMS Class Diagram

Generalization Specification dialog box

Figure 90 -- Generalization 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 The name of the parent element. To edit this element, click the ... button. The appropriated Specification dialog box appears. General Parent Element Set general information about the generalization relationship Child Element

The name of the child element. To edit this element, click the ... button. The appropriated Specification dialog box appears.

To group generalization paths into a tree


1 2 3 4

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.

To ungroup a generalization tree


1 Click the generalization trees hollow triangle pointing to a parent element. 2 From the tree shortcut menu, choose Ungroup Tree.

5-217

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

To separate the generalization path from the generalization tree


From the generalization path shortcut menu, choose Remove From Tree. Drag one generalization path to another class.

NOTE

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 Abstract Function Specifies whether the generalizable element may or may not have a direct instance. True indicates that an instance of the generalizable element must be an instance of a child of the generalizable element. False indicates that there may an instance of the generalizable element that is not an instance of a child. An abstract generalizable element is not instantiable since it does not contain all necessary information. Specifies whether the generalizable element is without descendents. True indicates that it may not have descendents False indicates that it may have descendents (whether or not it actually has any descendents at the moment.) Specifies whether the generalizable element is a root generalizable element with no ancestors. True indicates that it may not have ancestors, false indicates that it may have ancestors (whether or not it actually has any ancestors at the moment.)

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

Figure 91 -- 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 General Set general information about the association Box Association End A Name The name of the class A. Click the button, to open the Association End Specification dialog box. The multiplicity value of an association end A. The name of the class A. Click the button, to open the Class Specification dialog box. The name of the association end B. Click the button, to open the Association End Specification dialog box. Function

Multiplicity Element A Association End B Name

5-219

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Tab name

Box Multiplicity Element B

Function The multiplicity value of an association end B. The name of the classifier role B. Click the button, to open the Class Specification dialog box.

To show the direction arrow near the association name


From the association shortcut menu, select the Show Direction Arrow check box.

To draw an association class


In the class diagram, you may add attributes to an association using an association class. The association class is a simple class that has a dashed line connection to the association.
1 2 3 4 5 6

Draw two classes and the association path between them. Draw the third class. Click the Link Attribute button on the diagram toolbar. Click the third class shape (path source). Drag the path to the association path (path destination) and drop it there. If you need to model a relationship among a number of classes, N-ary association is used.

To draw N-ary association class


N-ary association is drawn as a big diamond with all the associations attached to its points. Every involved class may have role name and multiplicity.
1 Draw three classes on the Diagram pane. 2 Draw N-ary association connector icon. 3 Connect all classes and N-ary association connector icon using association

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.

To open the Association End Specification dialog box


1 Double-click the association path. The Association Specification dialog box

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.

2005 No Magic, Inc

5-220

UML DIAGRAMS Class Diagram

Association End Specification dialog box

Figure 92 -- Association End 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 General Set general information about the association end Box Element Initial Value Multiplicity Function The name of the class, to which the association end is related. Type the initial value for an association end. The association end multiplicity describes how many entities are participating at the each association end: 0 zero and only zero. 1 one and only one. 0..1 zero or one. 0..* - from zero to any positive integer. 1..* - from one to any positive integer. * - any positive integer.

5-221

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Tab name

Box Ordering

Function If the multiplicity is greater than one, then the set of related elements can be ordered or unordered. unordered - the elements form an unordered set. This is the default and need not be shown explicitly. ordered - the elements of the set have an ordering, but duplicates are still prohibited. This generic specification includes all kinds of ordering. This may be specified by the keyword syntax {ordered}. Additional information about the type. & - one class has a reference to other model element. * - one class has a pointer to other model element. [] one class has an array of other model elements. Specify whether the target value is an instance or a classifier. Instance. An instance value is part of each link. This is the default. Classifier. A classifier itself is part of each link. Normally this would be fixed at modeling time and need not be stored separately at run time. Set association ends visibility, which defines association ends access level Public. The association end can be accessed by any outside object. Package. Classifiers in the same package (or a nested subpackage, to any level) as the association declaration may navigate the association and use the role name in expressions. Private. The association end can be accessed only from inside the current class. Protected. The association end can be accessed from inside the current class and classes derived from that class. When placed on a target end, specifies whether the target end is an aggregation with respect to the source end. Only one end can be an aggregation. None. The end is not an aggregate. Aggregate. The end is an aggregate; therefore, the other end is a part and must have the aggregation value of none. The part can be contained in other aggregates. Composite. The end is a composite; therefore, the other end is a part and must have the aggregation value of none. The part is strongly owned by the composite and may not be part of any other composite.

Type Modifier

Scope

Visibility

Aggregation Kind

2005 No Magic, Inc

5-222

UML DIAGRAMS Class Diagram

Tab name

Box Changeability

Function Association ends 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. Make an association end navigable. By default both association end are set as navigable. The name of the assigned attribute of association end. The type of the assigned attribute of association end. It can be a class of primitive data type. Initial value of an attribute of an association end. The Attribute Specification dialog box appears. Edit the selected qualifier. The Attribute Specification dialog box appears. Specify the qualifier. Remove the qualifier from the list.

Navigable Qualifiers Name Define qualifiers of the Type association end. A qualifier is an attribute of an Initial value association end. Edit Add Remove

To define the association end name


1 Open the Association End Specification dialog box. 2 Type association end name in the Name box.

Choose Role A of <class name> or Role B of <class name> from the association shortcut menu, and then choose the Edit Name subcommand, then type or edit name directly on the Diagram pane.

To make a special case of an association path (aggregation/composition)


1 Open the Association End Specification dialog box. 2 Click the desired option button for an aggregation kind (None, Aggregate or

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. Click the Composition or Aggregation buttons and draw appropriated path on a diagram.

Right click an association path end and choose Aggregate or Composite command from the shortcut menu.

5-223

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

To change an associations navigability


An associations navigability indicates whether it is possible to traverse an association within expression of a classifier to obtain the object or set of objects associated with the instances. Navigability is shown as an arrow that can be attached to the end of the path to indicate that navigation is supported toward the classifier attached to the arrow.
1 Open the Association End Specification dialog box. 2 Select/clear the Navigable check box.

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.

NOTE

By default, an association is navigable in both sides and its navigability is not visible.

To define the association ends visibility


A role indicates a role played by the class in terms of an association. The role name is placed at the association end, near the class playing that role. The role name at the implementation level maps into the reference name to the opposite class. Roles may have visibility (public, protected, and private).
1 Open the Association End Specification dialog box. 2 From the Visibility drop-down list box, choose public, package, protected, or

private.

To place multiplicity values in the association path ends


The association end multiplicity describes how many entities are participating at the each association end: 0 zero and only zero. 1 one and only one. 0..1 zero or one. 0..* from zero to any positive integer. 1..* from one to any positive integer. * any positive integer.
1 Open the Association End Specification dialog box. 2 Type or choose from the list multiplicity value (1, *, 0..*, etc.) in the Multiplicity

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.)

2005 No Magic, Inc

5-224

UML DIAGRAMS Class Diagram

To define association ends changeability


Association end changeability:
Changeability name Changeable Frozen Function No restrictions on modification. 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. 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. 1 Open the Association End Specification dialog box. 2 Choose changeable, frozen or addOnly from the Changeability drop-down list

AddOnly

box.

To add, edit, or remove a qualifier to/from an association end


A qualifier is an attribute or list of attributes whose values serve to partition the set of instances associated with an instance across an association. The qualifiers are attributes of the association. A qualifier is shown as a small rectangle attached to the end of an association path between the final path segment and the symbol of the classifier that it connects to. The qualifier rectangle is part of the association path, not part of the classifier. The qualifier rectangle drags with the path segments. The qualifier is attached to the source end of the association.
1 Open the Association End Specification dialog box, the Qualifiers tab. 2 Click the Add or Edit button. The Attribute Specification dialog box appears.

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

2005 No Magic, Inc.

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

In MagicDraw, you will find two kinds of a realization relationship:


Realize. A dashed line with a solid triangular arrowhead. Realization. A relationship that is placed between a classifier and an interface that is shown as a solid line.

To create a realization tree if a class or an interface already has a number of realization paths attached to it
Choose the Make Sub Tree command from the class or the interface shortcut menu.

To remove a realization from the tree or to ungroup a tree

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

Double-click the path. Choose Specification from the path shortcut menu. Select the path and press ENTER.

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.

2005 No Magic, Inc

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.

Figure 93 -- Dependency kinds 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 General Box name Function Supplier Element Shows the name of the dependencys supplier element. Click the button. The corresponding element Specification dialog box appears. Client Element Shows the name of the dependencys client element. Click the button, the corresponding element Specification dialog box appears.

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

2005 No Magic, Inc.

UML DIAGRAMS Class Diagram

Define a binding dependency in the Binding Specification dialog box. Binding Specification dialog box

Figure 94 -- Binding 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 General Box name Function Supplier Element Shows the name of the dependencys supplier element. Click the button, the corresponding elements specification dialog box appears. Client Element Shows the name of the dependencys client element. Click the button, the corresponding elements Specification dialog box appears. The name of the template parameter. The type of the template parameter. It can be a classifier or a primitive data type. The default value of the template parameter. The default value of the initialized argument that can be changed. By default, it is the value of the template parameter. Edit the default value of the initialized arguments in the Type Init Value dialog box.

Initialized Arguments The list of the template parameters attached to the class.

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.

2005 No Magic, Inc

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

2005 No Magic, Inc.

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.

Figure 95 -- Schematic view of the use cases in the system.

2005 No Magic, Inc

5-230

UML DIAGRAMS Use Case Diagram

Use Case diagram elements


Element 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. Use case A use case is a classifier representing a coherent unit of functionality provided by a system, a subsystem, or a class as manifested by sequences of messages exchanged among the system and one or more outside interactors (called actors) together with actions performed by the system. Package A group of classes and other model elements. A package may contain other packages. Button (hot key) Notation

(A)

(U)

(P)

Subsystem A subsystem is treated as an abstract single unit and groups model elements by representing the behavioral unit in a physical system.

(Y)

System Boundary Another representation of a package. A system boundary element consists of use cases related by exclude or include (uses) relationships.

(B)

5-231

2005 No Magic, Inc.

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)

2005 No Magic, Inc

5-232

UML DIAGRAMS Use Case Diagram

Element Generalization A relationship between a more general and a more specific element.

Button (hot key)

Notation

(G)

Realization A realization relationship between a specification element and its implementation. 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.

(R)

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

2005 No Magic, Inc.

UML DIAGRAMS Use Case Diagram

Actor Specification dialog box

Figure 96 -- Actor Specification dialog box

Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements.

To display an actor as a class shape or as a stick man figure

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.

2005 No Magic, Inc

5-234

UML DIAGRAMS Use Case Diagram

To control a list of operations and attributes that are visible on a diagram


Choose Edit Compartment from the actor shortcut menu. The Compartment Edit dialog box appears. For a detailed descriptions, see Section Submit a Bug dialog box on page 9-470. An actor is a generalizable element and can be defined as Abstract, Leaf, or Root.

To define an actor as abstract, leaf, and/or root


1 Double-click the selected actor or choose Specification from the actor shortcut

menu. The Actor Specification dialog box appears. 2 Select the Abstract, Leaf, and/or Root check box in the General tab.

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

2005 No Magic, Inc.

UML DIAGRAMS Use Case Diagram

Use Case Specification dialog box

Figure 97 -- Use Case 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 General Box Load Profile Function Loads the Use Case description profile that contains specific extensions. The type of the assigned diagram. The name of the assigned diagram. Edit the name of the diagram in the Diagram Specification dialog box. The list of diagrams appears. Choose a diagram you want to assign and define a diagram in the Diagram Specification dialog box. Remove the selected diagram from the use case. The name of an extension point. The Extension Point Specification dialog box of the selected extension point appears. Define a new extension point. The Extension Point Specification dialog box appears. Removes the selected extension point from the use case.

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

Remove Extension Points Name Edit Add Remove

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

2005 No Magic, Inc

5-236

UML DIAGRAMS Use Case Diagram

To add an extension point for the use case


1 2 3 4

Open the Use Case Specification dialog box. Click the Extension Points tab. Click the Add button. The Extension Point Specification dialog box appears. Specify the extension point and click OK. Press CTRL+ALT+E. 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.

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.)

Use Case Extensions


MagicDraw presents UseCase description extensions. Now you may define pre-conditions and post-conditions for the use cases and other extensions, which are implemented as tag definitions. MagicDraw contains UseCase Description profile, which may be loaded from Use Case Specification dialog box. Tag defitions available in UseCase Description profile:
Group Conditions Description Tag Defitions PostCondition PreCondition Goal Implementation Issues Non Functional Requirements Notes Alternative Flow of Events Alternative Flow of Events Diagrams Basic Flow of Events Basic Flow of Events Diagrams Exceptional Flow of Events Exceptional Flow of Events Diagrams Author Date Priority Assumption Out-standing Issue

Flow of Events

Identity

Other IMPORTANT
5-237

2005 No Magic, Inc.

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.

To display tag definitions from the UC Description profile on the diagram


1 Open the UseCase Description profile UseCase_Profile.xml as a project (this 2 3 4 5

profile is located in the <MagicDraw installation directory>/profiles folder). In the Browser tree select the desired tag definition and open its Specification dialog box. Select the Show In Diagrams check box. Save the project. Reload the profile in the project you are working: from the UseCase Description Profile shortcut menu in the Browser tree, choose Modules, and then choose Reload Module.

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.

2005 No Magic, Inc

5-238

UML DIAGRAMS Use Case Diagram

Extend Specification dialog box

Figure 98 -- Extend 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 The base Use Case Specification dialog box appears. General Base Set general information about the extend relationship Extension Condition Extension Points Assign Select the extension points to be assigned on Unassign the extend relationship

The extension Use Case Specification dialog box appears. An expression specifying the condition, which must be fulfilled if the extension is to take place. Select already predefined extension points you wish to assign to the extend relationship in the Extension Points dialog box. Remove already created extension point from the use case.

To open the Extension Point Specification dialog box


1 Choose Specification from the use case shortcut menu, or double-click the use

case shape. The Use Case Specification dialog box appears. 2 Open the Extension Points tab and the Edit or Add buttons.
5-239

2005 No Magic, Inc.

UML DIAGRAMS Use Case Diagram

Extension Point Specification dialog box

Figure 99 -- Extension Point 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 The name of the use case, which owns the extension point. 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

The name of the model element you want to connect an extension point. The type of the linked model element. The name of the owner of the linked model element. The Select Model Element dialog box appears. Select a model element or diagram. Remove the selected model element or diagram from the extension point list.

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.

2005 No Magic, Inc

5-240

UML DIAGRAMS Use Case Diagram

Include Specification dialog box

Figure 100 -- Include 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 The base Use Case Specification dialog box appears. General Base Set general information about the include relationship Addition

The addition 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

2005 No Magic, Inc.

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.

2005 No Magic, Inc

5-242

UML DIAGRAMS Collaboration Diagram

Figure 101 -- Interaction representation in 3-Dimensional view

5-243

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

Collaboration Diagram elements


Element Instance A particular instance of a classifier. It has a unique name, state, and classifier as the type of identifier. Object, Use Case Instance, and Subsystem Instance can be created in 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)

2005 No Magic, Inc

5-244

UML DIAGRAMS Collaboration Diagram

Element 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.

Button (hot key)

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:

In this section the Specification dialog box of Object, Instance, Use Case Instance, and Subsystem Instance will be described.

5-245

2005 No Magic, Inc.

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.

Figure 102 -- Instance 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 Assigned Classifiers A template is the descriptor for a instance with one or more unbound formal parameters. Box name Name Type Owner Edit Assign Unassign 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) Type Attribute Instance Function The name of the assigned classifier. The type of the assigned classifier. The name of the owner of the assigned classifier. Edit the assigned classifier in the Specification dialog box appears. The Select Model Element dialog box appears. Select classifiers you wish to assign. Unassign the selected classifier from the instance. The name, which is the owner of the attribute. The name of the attribute. The name of an instance, to which the current instance is set as a default value.

2005 No Magic, Inc

5-246

UML DIAGRAMS Collaboration Diagram

To assign an already existing classifier to an instance


1 Draw an instance on the diagram pane. 2 Right-click the instance shape and choose Classifier from the instance shortcut

menu. 3 Choose the classifier you wish to assign to an instance.

To assign/change/ unassign a previously existing classifier to/for an instance in the Instance Specification dialog box
1 Draw an instance on the diagram pane. 2 Double-click an instance shape or choose Specification from the shape shortcut

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 edit a previously created classifier, click the Edit button. The corresponding Specification dialog box appears. To unassign the assigned classifier, click the Unassign button.

To hide/show an assigned classifier


From the instance shortcut menu, select/clear the Show Classifier check box.

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.

To set initial value to an attribute of the assigned classifier


1 Draw an instance on the diagram pane. Double-click an instances shape or

choose Specification from the shape shortcut menu. 2 The Instance Specification dialog box appears. Click the Slots tab. 3 Click the Edit button. The Initial Value dialog box appears. 4 Type the name of the initial value.

To show/hide attributes of the assigned classifier


Clear/select Suppress Attributes check box in the instance shortcut menu.
NOTE

By default attributes of the classifier are suppressed.

5-247

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

To select attributes to be shown on the instance


1 Choose Edit Compartment from the instance shortcut menu. The Compartment NOTE

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.

Figure 103 -- Composite object

To create a composite object


1 Click the Object button on the diagram toolbar or press key O (the button 2 3 4 5 6

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.

2005 No Magic, Inc

5-248

UML DIAGRAMS Collaboration Diagram

Link Specification dialog box

Figure 104 -- Link 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 The name of the link end A. Click the button to open the Link End Specification dialog box. The name of the model element The name of the link end B. Click the button to open the Link End Specification dialog box. The name of the model element The name of the stimulus. The type of stimulus action is displayed. The name of the source link. The name of the shape from which the path begins. Stimulus destination. The name of the shape where the path ends. General Link End A Set general Name information about the link relationship Element A Link End B Name Element B Stimulus Contains the list of stimulus which the current link participates. Name Action Type Begins Ends

5-249

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

Tab name

Box name Edit Remove

Function The Stimulus Specification dialog box appears. Edit the stimulus. Removes the selected stimulus.

To open the Link End Specification dialog box


1 Choose Specification from the link shortcut menu, or double-click the link. The

Link Specification dialog box appears. 2 Click the button in the Link End A or Link End B group boxes. Link End Specification dialog box

Figure 105 -- Link End 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 General Set general information about the link end Box name Name Function Type the link end name. NOTE The name of the link end is not visible on the diagram. The name of an instance at the link end.

Instance

2005 No Magic, Inc

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

Figure 106 -- 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 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. Base Classifier General Set general information about the classifier role Multiplicity

5-251

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

To assign a base classifier to a classifier role


1 Right-click the classifier role shape and choose Classifier from the classifier

roles shortcut menu. 2 Choose the classifier you wish to assign to a classifier role.

To assign/change base classifier of a classifier role


1 Double-click a classifier role shape or choose Specification from the shape

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.

To hide/show a base classifier


Choose Show Classifier from the classifier role shortcut menu.

To set multiplicity indicator for a classifier role


1 Double-click a classifier roles shape or choose Specification from the shape

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.

2005 No Magic, Inc

5-252

UML DIAGRAMS Collaboration Diagram

To open the Association End Role Specification dilaog box


You may define association end roles name, initial value, multiplicity, type modifier, visibility, changeability, ordering, scope, aggregation king, and navigability.
1 Double-click the association role or choose Specification from the association

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

Figure 107 -- Association Role Specification dialog box

5-253

2005 No Magic, Inc.

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 Name The multiplicity value of an association end role A. The name of the classifier role A. The name of the association end role B. Click the button to open the Association End Role Specification dialog box. The multiplicity value of an association end role B. The name of the classifier role B. A comment associated with the current association role. 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. The name of the message. The message type: message. The name of the source of the association role. The name of the shape from which the path begins. Message destination. The name of the shape where the path ends. The Message Specification dialog box appears. Edit the message.

Association End Role B

Multiplicity Element B Documentation

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 Type Begins Ends Edit

Remove

Removes the selected message.

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.

2005 No Magic, Inc

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 Asynchronous message / stimulus Synchronous message / stimulus Function The sender is not waiting for acceptance from the recipient. Notation

The operation that is called should be completed before the caller resumes execution.

Balking message / The sender abandons the message if the stimulus receiver is not ready. NOTE: Set this type of message / stimulus in the Message / Stimulus Specification dialog box, Stereotypes tab. Time-out message The sender waits for acknowledgment from / stimulus the recipient for a given period of time. NOTE: Set this type of message / The sender is freed up if the acknowledgment stimulus in the does not occur within Message / the duration specified Stimulus in the description. Specification dialog box, Stereotypes tab.

To open the Message Specification dialog box

Choose Specification from the message shortcut menu or double-click the message. Open the Association Role Specification dialog box. Open the Messages tab and click the Edit button.

5-255

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

Message Specification dialog box

Figure 108 -- Message 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 General Set general information about the message Box name Action Type Function The type of the action: uninterpreted, call, send, create, return, destroy, or terminate. Click the button to open the Action Specification dialog box. The name of the sender classifier role. Click the button to open the Classifier Role Specification dialog box. The name of the receiver classifier role. Click the button to open the Classifier Role Specification dialog box. The arguments of the action are shown. To edit the return value, click the ... button. The Action Specification dialog box appears. The number of the predecessor message An action that performs that message. The Message Specification dialog box appears.

Sender

Receiver

Return Value

Predecessors The set of Messages whose completion enables the execution of the current Message. All of them must be completed before execution begins.

Number Action Edit

2005 No Magic, Inc

5-256

UML DIAGRAMS Collaboration Diagram

To open the Stimulus Specification dialog box

Choose Specification from the stimulus shortcut menu or double-click the stimulus. Open the Link Specification dialog box. Open the Stimulus tab and click the Edit button.

Stimulus Specification dialog box

Figure 109 -- Stimulus 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 The type of the action: uninterpreted, call, send, create, destroy. Click the button, to open the Action Specification dialog box. The name of the sender instance. Click the button, to open the Instance Specification dialog box. The name of the receiver instance. Click the button, to open the Instance Specification dialog box. The name of the link relationship. Click the button, to open the Link Specification dialog box. General tab Action Type Set general information about the stimulus Sender

Receiver

Link

5-257

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

To draw a stimulus/message on the link/association role


1 Click the Message/Stimulus to Right or Left button on the diagram toolbar or

NOTE

press shortcut keys R or E (the button remains pressed.) 2 Click the desired link/association on the Diagram pane. A stimulus/message arrow is placed to the link/association role you click on the diagram. A message flow has two directions: right and left. Choose one of them by clicking an associated button on the diagram toolbar.

To set an action for a message/stimulus


1 Open the Message Specification or Stimulus Specification dialog box. 2 Click the Action Type ... button. The Action Specification dialog box

appears. 3 Choose the action type from the Type drop-down box. See Section Actions on page 5-260.

To show/hide the numbers of the messages/stimulus


From the collaboration diagram shortcut menu, choose Numbering and then select/clear the Show Meesage Numbers check box.

To remove advanced automatic numbering of messages


From the collaboration diagram shortcut menu, choose Numbering and then clear the Advaced Message Numbering check box and you will be able to number messages according your needs.

To change the numbering of the messages/stimulus


1 From the collaboration diagram shortcut menu, choose the Change

Numbering command.

2005 No Magic, Inc

5-258

UML DIAGRAMS Collaboration Diagram

2 Increase, decrease, and/or change the level of numbering in the Change

Collaboration Numbering dialog box:

Figure 110 -- Change Collaboration Numbering dialog box

Box name Number Type Name Edit Increase Decrease OK Cancel Help

Function The number of the stimulus/message. Displays the type stimulus or message for which the numbering is being edited. The type, name of the action of the corresponding stimulus/message. The Type Number dialog box appears. Type the number of the stimulus/message. Increases the selected number in one point. Decreases the selected number in one point. Saves changes and exits the dialog box. Exits the dialog box without saving changes. Displays the MagicDraw Help.

PREDECESSORS AND ACTIVATORS Predecessor is the set of messages/stimulus whose completion enables the execution of the current message. The predecessor is a comma-separated list of sequence numbers followed by a slash (/): sequence-number , . . . / The meaning is that the message is not enabled until all of the communications whose sequence numbers appear in the list have occurred. Therefore, the list of predecessors represents a synchronization of threads. The message corresponding to the numerically preceding sequence number is an implicit predecessor and need not be explicitly listed.

5-259

2005 No Magic, Inc.

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.

To show predecessors on the message


Choose Show Predecessors from the current message shortcut menu. Choose Symbol(s) Properties command from the message shortcut menu and select the Show Predecessors check box.

To change the activator number of the messages


1 Choose Activator command from the current message shortcut menu. 2 Choose the number of activator that you want to assign for the current message NOTE:

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.

To open the Action Specification dialog box

In the Composite State Specification, Action State Specification, Submachine State Specification, Object Flow State, or Subactivity State Specification dialog boxes, Detail tab click the Edit button in the Actions group 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.

2005 No Magic, Inc

5-260

UML DIAGRAMS Collaboration Diagram

Action Specification dialog box

Figure 111 -- Action 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: Tab name

The name of the dialog box changes according action type.


Box 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 Choose the type of an action: call, send, create, return, destroy, terminate, uninterpreted, or sequence. NOTE: If action type is sequence, you may specify a sequence of various kinds of actions. More information see in Section Actions on page 5-260.

General Script Set general information about Target the action

5-261

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

Tab name

Box Operation (only for call action)

Function Choose operations if a state diagram is assigned to a class, which contains operations. NOTE The parameters of an operation are automatically added to the Arguments list. Shows the classifier of which an instance will be created of when the create action is performed. Type an expression that states how many times the action should be performed. An iteration represents a sequence of Messages at the given nesting depth. As UML does not prescribe its format MagicDraw uses a * sign to represent an iteration. An example would be: *[i := 1..n]. Defines an action as asynchronous. Shows the defined argument expression. The Type Expression dialog box appears. Edit an expression and click OK. The Type Expression dialog box appears. Type an expression and click OK. Removes an argument expression.

Instantiation (Only for create action) Recurrence / Condition Iteration

Asynchronous Arguments An argument is an expression describing how to determine the actual values passed in a dispatched request. Expression Edit Add Remove

2005 No Magic, Inc

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. An action in which a stimulus is created that causes an operation to be invoked on the receiver. An action in which a stimulus is created that causes a signal event for the receiver(s). An action in which an instance causes another instance to cease to exist.

Instantiation Stimulus and (classifier) - the message Classifier of which an Instance will be (new) created when the Create Action is performed. Operation - the operation, which will be invoked when the Action is executed. Stimulus and message

Message is connected directly to an object (not lifeline).

Call

Send

Stimulus and message

Destroy

Stimulus and message

A large X mark is displayed on the objects lifeline in the messages destination.

An action that has Uninterpreted no interpretation in UML. Return An action that returns a value to a caller. An action in which an instance causes itself to cease to exist. An action that assigns an instance to an attribute link, or a link.

Stimulus and message Message

Terminate

Message

Assignment

Message

Set the following features for an action in the Action Specification dialog box.

5-263

2005 No Magic, Inc.

UML DIAGRAMS Collaboration Diagram

Attribute Recurrence /Condition Script

Description An expression which states how many times the Action should be performed.

How to Type an expression in the Recurrence/Condition text box.

An action expression Type an expression in the Script text describing the effects of the box. action. An argument is an expression describing how to determine the actual values passed in a dispatched request. It is aggregated within an action. Click the Arguments tab. To enter a new argument expression, click the Add button. The Type Expression dialog box appears. Type an expression and click OK. To edit an argument expression, click the Edit button. The Type Expression dialog box appears. Edit the expression and click OK. To remove an argument expression, click the Remove button or press DELETE.

Argument

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.

To draw an active object in a collaboration or sequence diagram


1 Create an active class by selecting Active check box in the Class Specification

dialog box. An active class is shown as a rectangle with heavy borders. 2 Create an instance of this class as an active object.

2005 No Magic, Inc

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

2005 No Magic, Inc.

UML DIAGRAMS Sequence Diagram

Sequence diagram elements


Model elements Classifier Role An instance of a class. An object has identity, attribute values, a unique name, a state, and a class as the type of identifier. Lifeline Represents the existence of an object at a particular time. 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)

2005 No Magic, Inc

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. Message to Self

Button (hot key)

Notation

(M)

(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

2005 No Magic, Inc.

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.

2005 No Magic, Inc

5-268

UML DIAGRAMS Sequence Diagram

Interaction Use Specification dialog box

Figure 112 -- Interaction Use Specification dialog box

Tab name

Box

Function A list of collaboration, sequence and time diagrams, created in the project, appears. Click ... button, to edit specification of the diagram. Click the New button to create a new collaboration, sequence, or time diagram. Type value for attribute. Type return value. A list of specified arguments appears.Click the Add button for creating new argument. Edit and remove value actions can be performed too.

Refers To Combobox Reference to specified diagram.

Attribute Return value Arguments

Text box Text box 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

2005 No Magic, Inc.

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

Figure 113 -- Combined Fragment Specification dialog box

Tab name Guard Operator

Box Text box Combobox

Function Guard is interatction constraint. Typed value will be displayed in angle brackets. Select the operator for fragment. Available: alt, assert, break, consider, critical, ignore, loop, neg, opt, par, seq, strict. Separated alternative part of interaction fragment. Click the Add button for creating new value. Edit and remove value actions can be performed too.

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.

2005 No Magic, Inc

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. Set a message as destroyed.

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.

To change activation bar size


1 Click the desired activation bar on the Diagram pane. 2 Drag an activation bar to the desired direction. NOTE

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.

To add a concurrent lifeline to a lifeline


Click the Concurrent Lifeline button on the diagram toolbar and click the lifeline on the desired place where you wish to draw a concurrent lifeline. A branch is shown by multiple arrows leaving a single point, each labeled by a guard condition. Depending on whether the guard conditions are mutually exclusive, the construct may represent conditionality or concurrency.

To draw a branching of messages


1 Draw a message from one lifeline to another. 2 Draw another message from one message to the concurrent lifeline or a lifeline.

5-271

2005 No Magic, Inc.

UML DIAGRAMS Sequence Diagram

Messages in sequence diagram


Messages are the main tool for displaying an interaction between objects, which is usually an operation call or creation and destruction event. Messages are labeled with the name (operation or signal) and their argument values. Define the selected message in the Message Specification dialog box. For more information on working with messages, Section Stimulus / Message on page 5-254 and Section Actions on page 5-260.
Message type Synchronous Function 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 means that the source is not waiting for the acceptance. Notation

Asynchronous

Balking message

In the balking message case the sender abandons the message NOTE: Set this if the receiver is not type of message ready. in the Message Specification dialog box, Stereotypes tab.

2005 No Magic, Inc

5-272

UML DIAGRAMS Sequence Diagram

Message type Time-out

Function

Notation

A time-out message the sender sends for a given NOTE: Set this period of time while type of message waiting for in the Message acknowledgment by recipient. The sender is Specification freed up if the dialog box, Stereotypes tab. acknowledgment does not occur within the duration specified in the description. Call Call action is an action in which a stimulus is created that causes an operation to be invoked on the receiver.

Send

Send action is an action in which a stimulus is created that causes a signal event for the receiver(s).

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

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

Message type Destroy

Function Destroy action is an action in which an instance causes another instance to cease to exist.

Notation

Terminate

Terminate action is an action in which an instance causes itself to cease to exist. A simple message shows the control flow from a sender to a receiver without presenting any details about the communication process.

Uninterpreted

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.

State Diagram elements


NOTE

If a black arrow is placed on a button, right-click the button, to open other available buttons.
Button (hot key) Notation

Model elements 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. Concurrent State A state containing other state vertices (states, pseudostates, etc.). It is useful when a given object contains sets of independent behaviors. 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).

(S)

(C)

(M)

(A)

5-275

2005 No Magic, Inc.

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.

Button (hot key)

Notation

(K)

(I)

(F)

(Y)

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.

(R)

(J)

2005 No Magic, Inc

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.

Button (hot key)

Notation

(D)

(U)

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.

(V)

(B)

(T)

(E)

5-277

2005 No Magic, Inc.

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. The second compartment - activity compartment - events and actions of the state are listed. The third compartment - optional state variable compartment - attributes can be listed and assigned. The attributes are those of the class displayed by the state diagram.

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

Figure 114 -- Composite State Specification dialog box

2005 No Magic, Inc

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 Detail Contains the state actions, events and buttons for editing list. Box name Actions group box Entry Edit Remove Exit Edit Remove Do Activity Edit Remove Name 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. 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 The type of the entry action. The Action Specification dialog box appears. Remove the entry action. The type of the exit action The Action Specification dialog box appears. Remove the exit action. The type of the do activity action The Action Specification dialog box appears. Remove the do activity action. The name of the event The Event Specification dialog box appears. Edit the selected event. Add a new event to the state. The Event Specification dialog box appears. Remove the selected event from the state. The name of the internal transition. The Transition Specification dialog box appears. Edit the transition. The Transition Specification dialog box appears. Define a new transition. Remove the selected transition from the state. Function

Deferrable Events group box

Name Edit Add Remove

The name of the attribute. Edit the name of the attribute in the Type Name screen. Type the name of the new state attribute in the Type Name screen. Remove the selected attribute from the state. The type and name of the assigned composite, final, concurrent, call, action, or submachine state. The corresponding (state, concurrent state, submachine state, action state, call state, or final state) specification dialog box appears. Edit the selected inner state in the dialog box.
2005 No Magic, Inc.

Inner States Name The list of inner states and buttons Edit for editing them.

5-279

UML DIAGRAMS State Diagram

Tab name

Box name Add

Function Select the inner state you want add. The corresponding (state, concurrent state, submachine state, action state, call state, or final state) specification dialog box appears. Define the selected mod in the dialog box. Remove the selected inner state from the state.

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.

To suppress/unsuppress actions compartment


In the state shortcut menu, select/clear the Suppress Actions check box.

To suppress/unsuppress attributes compartment


In the state shortcut menu, select/clear the Suppress Attributes check box.

To insert a new attribute directly in the state


Choose Insert New Attribute from the state shortcut menu. Open the Composite State Specification dialog box, Attributes tab and click the Add button. Specify attribute name in the Type Name dialog box. Select a state and press CTRL+ALT+A shortcut keys.

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.

To open the State Specification dialog box


1 Open the Composite State Specification dialog box, Inner States tab. 2 Click the Add or Edit (if available) button. Select State from the appeared list.

2005 No Magic, Inc

5-280

UML DIAGRAMS State Diagram

State Specification dialog box The description of this dialog box is the same as Final State Specification dialog box.

Figure 115 -- 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 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 Name Edit Add Remove Remove the entry action. The type of the exit action The Action Specification dialog box appears. Remove the exit action. The type of the do activity action The Action Specification dialog box appears. Remove the do activity action. The name of the event The Event Specification dialog box appears. Edit the selected event. Add a new event to the state. The Event Specification dialog box appears. Remove the selected event from the state.

Deferrable Events group box

5-281

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

Tab name 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.

Box name Name Edit Add Remove

Function The name of the internal transition. The Transition Specification dialog box appears. Edit the transition. The Transition Specification dialog box appears. Define a new transition. Remove the selected transition from the state.

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 add a new region to the concurrent state


Choose Add New Region from the concurrent state shortcut menu.

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.

2005 No Magic, Inc

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

Figure 116 -- 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 General Detail Contains the submachine actions, events and buttons for editing list. Box name Include Actions group box Entry Edit Remove Exit Edit Remove Do Activity Edit Remove Name The type of the entry action. The Action Specification dialog box appears. Remove the entry action. The type of the exit action The Action Specification dialog box appears. Remove the exit action. The type of the do activity action The Action Specification dialog box appears. Remove the do activity action. The name of the event Function Select the state machine or activity diagram to include in the submachine.

Deferrable Events group box

5-283

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

Tab name

Box name Edit Add Remove

Function The Event Specification dialog box appears. Edit the selected event. Add a new event to the object flow submachine. The Event Specification dialog box appears. Remove the selected event from the object flow submachine. The name of the internal transition. The Transition Specification dialog box appears. Edit the transition. The Transition Specification dialog box appears. Define a new transition. Remove the selected transition from the submachine.

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. 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

Name Edit Add Remove

The name of the attribute. Edit the name of the attribute in the Type Name screen. Type the name of the new submachine attribute in the Type Name screen. Remove the selected attribute from the submachine.

Inner States Name Only the stub Edit state can be added to the submachine state. Add Remove

The type and name of the assigned stub state. The Stub State Specification dialog box appears. Edit the stub state. The Stub State Specification dialog box appears. Define the stub state. Remove the selected stub state from the submachine.

For more information on submachine states see, Section State on page 5-278 Define a stub state in the Stub State Specification dialog box. .

To include a state machine or activity graph into a submachine state


1 Double-click the submachine state or choose Specification from the

submachine state shortcut menu. The Submachine State Specification dialog box appears. 2 Choose a state machine or activity graph you wish to include in the submachine from the Include drop-down box.

2005 No Magic, Inc

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: Tab name 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.

The name of the dialog box changes according state vertex type.
Box name Function 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.

To set the bound number for the synch state


1 Double-click the synch state or choose Specification from the shape shortcut

menu. The Synch State Specification dialog box appears. 2 Choose Specified from the Bound drop-down box. Type the numeric value in the text box. The number must be not less than 0 and not greater than 2147483647.

5-285

2005 No Magic, Inc.

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.

Figure 117 -- History State

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.

To define a history state


Select/clear the Deep History check box from the history state shortcut menu.

2005 No Magic, Inc

5-286

UML DIAGRAMS State Diagram

JUNCTION AND DYNAMIC CHOICE POINTS Junction point is used for joining and splitting transition paths. Regardless of whether the junction point was reached from state State 0 or from state State, the outgoing paths are the same for both cases. If the state machine in this example is in state State1 and b is less than 0 when event e1 occurs, the outgoing transition will be taken only if one of the three downstream guards is true. Thus, if a is equal to 6 at that point, no transition will be triggered. 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. Note that the action associated with that incoming transition computes a new value. This new value can then be used to determine the outgoing transition to be taken.

Actions in State and Activity diagrams


The action label identifies the circumstances under which the action specified by the action expression will be invoked. For more information on defining actions, see Section Actions on page 5-260. Specify actions in Action Specification dialog box. The general format for the list of actions: action-label / action-expression.

To define an action label


1 Double-click the state, or choose Specification from the state shortcut menu.

The Composite State Specification dialog box appears. 2 Click the Detail tab. 3 Select an Entry, Exit or Do Activity action label in the Actions group box. To add or edit an action label, click the Edit button. The Action Specification box appears. Specify an action.

To remove an action label, click the Remove button.

5-287

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

ACTION
Entry Exit

LABELS

Action name

Description An action, specified by the corresponding action expression, which is performed upon entry to the state (entry action.) An action, specified by the corresponding action expression, that is performed upon exit from the state (exit action) An ongoing activity that is performed as long as the modeled element is in the state, or until the computation specified by the action expression is completed (the latter may result in a completion event being generated).

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.

To open the Event Specification dialog box

Open the Composite State Specification, Action State Specification, Submachine State Specification, or Subactivity State Specification dialog box. In the Detail tab, click the Edit or Add button in the Deferrable Events group box. In the Transition Specification dialog box, click the Edit button in Trigger group box.Event Specification dialog box

Figure 118 -- Event Specification dialog box

2005 No Magic, Inc

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

The name of the dialog box changes according to event type


Box Function Define the type of event: signal, call, time, or change.

General Type Set general information about the event Expression 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

Type an expression for an event.

Choose the defined operation. You may choose operation from the list when a diagram is drawn for a classifier, which contains operations.

Shows the parameters name. Shows the parameters type. It can be a classifier or a data type. An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter. Specifies what kind of a parameter is required: in - an input parameter (may not be modified). out - an output parameter (can be modified to communicate information to the caller). inOut - an input parameter that can be modified. Move the selected item up the list Move the selected item down the list. The Parameter Specification dialog box appears. The Parameter Specification dialog box appears. Removes the parameter.

Direction kind

Up Down Edit Add Remove

To define an event in the Event Specification dialog box

In the Composite State Specification, Action State Specification, Submachine State Specification, or Subactivity State Specification dialog box, Detail tab click the Edit button in the Actions group box. In the Transition Specification dialog box, click the Edit button in Trigger group box.

5-289

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

EVENT

TYPES

Name Signal Call

Description A signal event represents the reception of a particular (asynchronous) signal. Signal Event is a child of Event. A call event represents the reception of a request to synchronously invoke a specific operation. (Note that a call event instance is distinct from the call action that caused it.) The expected result is the execution of a sequence of actions, which characterize the operation behavior at a particular state. Operation designates the operation whose invocation raised the call event. A Time Event models the expiration of a specific deadline. Note that the time of occurrence of a time event instance (i.e., the expiration of the deadline) is the same as the time of its reception. Expression specifies the corresponding time deadline: keyword after, followed by an expression. A change event models an event that occurs when an explicit boolean expression becomes true as a result of a change in value of one or more attributes or associations. A change event is raised implicitly and is not the result of some explicit change event action. Expression specifies the change event: keyword when followed by an expression.

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

To define an internal transition


1 Double-click the state or choose Specification from the state shortcut menu. The

Composite State Specification dialog box appears. 2 Click the Internal Transitions tab. 3 Click the Add or Edit button. The Transition Specification dialog box appears. Specify an internal transition. To remove an internal transition, click the Remove button.

2005 No Magic, Inc

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

2005 No Magic, Inc.

UML DIAGRAMS State Diagram

Figure 119 -- Transition 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 The name of the model element (state, submachine, action state, concurrent state, subactivity, other), which is the target of the transition. The corresponding Composite State Specification, State Specification, Submachine State, State Specification, Action State Specification, Subactivity Specification, or State Vertex Specification dialog box appears, which is the target of the transition. The name of the model element (state, submachine, action state, concurrent state), which is the source of the transition. The corresponding Composite State Specification, State Specification, Submachine State, State Specification, Action State Specification, Subactivity Specification, or State Vertex Specification dialog box appears, which is the source of the transition. The type of the event The Event Specification dialog box appears. Remove the trigger event. The type of the effect action The Action Specification dialog box appears. Remove the effect action. The guard expression. The Guard Specification dialog box appears. Remove the guard expression. General Target Set general information about the transition

Source

Trigger group box Type Edit Remove Effect group box Type Edit Remove Guard group box Expression 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.

To edit a source/target state of the transition path


1 Double-click the transition path or choose Specification from the paths shortcut

menu. The Transition Specification dialog box appears. 2 Click the Source/Target ... button.

2005 No Magic, Inc

5-292

UML DIAGRAMS State Diagram

3 The Composite State Specification dialog box appears in a state diagram

appears or Action State Specification dialog box in an activity diagram appears.

To specify a trigger event for a transition


Trigger specifies the event that fires the transition. There can be at most one trigger per transition.
1 Double-click the transition path or choose Specification from the paths shortcut

NOTE

menu. The Transition Specification dialog box appears. 2 In the Trigger group box, click the Edit button. (To remove a trigger event, click the Remove button.) 3 The Event Specification dialog box appears. See Section Events on page 5-288. Trigger event box is not available when a transition source is an initial state, junction/dynamic choice point, vertical/horizontal synchronization bar, or history state.

To specify an effect action for a transition


Specifies an optional action to be performed when the transition fires.
1 Double-click the transition path or choose Specification from the paths shortcut

menu. The Transition Specification dialog box appears. 2 In the Effect group box, click the Edit button. (To remove an effect action, click the Remove button.) 3 The Action Specification dialog box appears. See Section Actions in State and Activity diagrams on page 5-287.

To specify a guard expression (condition) for a transition


A guard expression provides a fine-grained control over the firing of the transition. It is evaluated at the time the event is dispatched. There can be at most one guard per transition.
1 Double-click the transition path or choose Specification from the path shortcut

menu. The Transition Specification dialog box appears. 2 In the Guard group box, click the Edit button. (To remove a guard expression, click the Remove button.) 3 The Guard Specification dialog box appears. 4 Type an expression in the Expression text box.

GUARD SPECIFICATION DIALOG BOX A guard is a boolean expression that is attached to a transition as a fine-grained control over its firing. The guard is evaluated when an event instance is dispatched by the state machine. If the guard is true at that time, the transition is enabled, otherwise, it is disabled.

5-293

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

To open the Guard Specification dialog box


1 Choose Specification from the transition paths shortcut menu, or double-click

the transition path. The Transition Specification dialog box appears. 2 Click the Edit button in the Guard group box.

Figure 120 -- Guard 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 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. Type the guard expression. Checks Object Constraint Language (OCL) syntax if guard is described using OCL. General Name Set general information about the guard 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

2005 No Magic, Inc

5-294

UML DIAGRAMS Activity Diagram

case, or to a package, or to the implementation of an operation. The purpose of this diagram is to focus on flows driven by internal processing (as opposed to external events). You should use activity diagrams in situations where all or most of the events represent the completion of internally-generated actions (that is, procedural flow of control). You should use ordinary state diagrams in situations where asynchronous events occur. An activity diagram is a variant of a state diagram. Organized according to actions, activity diagrams are mainly targeted towards the representation of the internal behavior of a method (the implementation of an operation) or a use case. Though activity diagrams are often classified alongside interaction diagrams, they actually focus on work performed by a system instead of an object interaction. An activity diagram captures actions and displays their results. A state diagram may also represent this sequencing of steps. However, given the procedural nature of the implementation of the operations in which most events simply correspond to the end of the preceding activity it is not necessary to distinguish states, activities, and events systematically (i.e., state changes and external events have less importance inside the method). It is therefore beneficial to have a simplified representation for directly displaying activities. An activity diagram is a convenient way to describe complex algorithms, parallel operations, and business processes. Together with the collaboration and sequence diagrams, they are used to relate use cases. A state diagram may also represent this sequencing of steps. However, given the procedural nature of the implementation of the operations in which most events simply correspond to the end of the preceding activity it is not necessary distinguish states, activities, and events systematically (i.e. state changes and external events arent so important inside the method). It is therefore beneficial to have a simplified representation for directly displaying activities. An activity diagram is a convenient way to describe complex algorithms, parallel operations, and business processes. They are used to relate use cases together with the collaboration and sequence diagrams.

5-295

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Activity Diagram elements


Element 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). 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. 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. Concurrent State A state containing other state vertices (states, pseudostates, etc.). It is useful when a given object contains sets of independent behaviors. Submachine State Represents the invocation of a state machine defined elsewhere. Button (hot key) Notation

(A)

(S)

(K)

(C)

(M)

2005 No Magic, Inc

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. Initial State Denotes an initial state when an object is created. Final State Denotes an objects destruction or the end of collaboration. 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. Exception Handler An element that specifies a body to execute in case the specified exception occurs during the execution of the protected node.

Button (hot key)

Notation

(Q)

(SHIFT +T)

(I)

(F)

(SHIFT +F)

(T)

5-297

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Element Horizontal Synchronization Bar Helps to control parallel actions. Vertical Synchronization Bar Helps to control parallel actions. 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.

Button (hot key)

Notation

(B)

(V)

(SHIFT +I)

(SHIFT +O)

(D)

Signal Receipt (R)

Signal Sending (G)

2005 No Magic, Inc

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.

Button (hot key)

Notation

(P)

(O)

(SHIFT +B)

Data Store It is a central buffer node for non-transient information.

(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

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Action State Specification dialog box

Figure 121 -- Actions 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 Function Choose or type the multiplicity value for an action state. The Multiplicity drop-down box is activated only when an action state is set as dynamic. Type an argument expression for an action state. The Arguments box is activated only when an action state is set as dynamic. Select the Dynamic check box and set an action state as dynamic. Shows the type of an entry action. The Action Specification dialog box appears. Define an action state. Remove the defined action. Shows the list of the defined events. The Event Specification dialog box appears. Edit the event. General Multiplicity Set general information about an action state Arguments

Dynamic Detail Actions: Entry Define an entry Edit action and events. Remove Deferrable Events: Name Edit

2005 No Magic, Inc

5-300

UML DIAGRAMS Activity Diagram

Tab name

Box Add Remove

Function The Event Specification dialog box appears. Define an event. Remove the defined event

To define an action state as dynamic


Depending on runtime information, the Dynamic attribute of an action state determines whether multiple invocations of state might be executed concurrently.
1 Double click an action state or choose Specification from the shape shortcut

menu. The Action State Specification dialog box appears. 2 Select the Dynamic check box, found on the bottom of the dialog box.

To set multiplicity for a dynamic action state


A multiplicity in an action state indicates the number of parallel executions of the actions of state. If the dynamic concurrency of an action state is not always exactly one, its multiplicity is shown in the upper left corner of the state.
1 Double-click an action state, or choose Specification from the shape shortcut

NOTE

menu. The Action State Specification dialog box appears. 2 Set the multiplicity value in the Multiplicity drop-down list box. Multiplicity is activated only when an action state is defined as dynamic.

To define arguments for a dynamic action state


An Argument expression determines the number of parallel executions of the actions of the state at runtime. The value must be a set of lists of objects, each list serving as arguments for one execution.
1 Double click an action state, or choose Specification from the shape shortcut

menu. The Action State Specification dialog box appears. 2 Type an argument in the Arguments text box.

To define an entry action for an action state


1 Double-click an action state, or choose Specification from the shape shortcut

menu. The Action State Specification dialog box appears. 2 Click the Detail tab. 3 In the Actions group: To add or edit an action label, click the entry Edit button. The Action Specification box appears. Specify an action.

To remove an action label, click the Remove button.

NOTE

For more information defining actions, see Section Actions on page 5-260 and Section Actions in State and Activity diagrams on page 5-287.

5-301

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

To define events for an action state


See Section Events on page 5-288.

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.

To draw a call state and select an operation it invokes


1 Draw a class. 2 Add an operation to the class. 3 In the Browser, open class shortcut menu and from the State/Activity Diagram,

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."

2005 No Magic, Inc

5-302

UML DIAGRAMS Activity Diagram

Define the selected subactivity state in the Subactivity State Specification dialog box.

To open the Subactivity State Specification dialog box


Choose Specification from the subactivity state shortcut menu, or double-click the subactivity state shape. Subactivity State Specification dialog box

Figure 122 -- 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 Function Select the already created state machine or activity diagram to include in the subactivity state. General Include Set general information about the subactivity state

5-303

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Tab name

Box name 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

Function Select the multiplicity value from the list or type it directly in the text box. A multiplicity limiting the number of parallel executions of the actions of state.

Type an expression that determines the number of parallel executions of the submachine of the state. The value must be a set of lists of objects, each list serving as arguments for one execution.

Specifies whether the state's submachine might be executed concurrently. The type of the entry action. The Action Specification dialog box appears. Remove the entry action. The type of the exit action The Action Specification dialog box appears. Remove the exit action. The type of the do activity action The Action Specification dialog box appears. Remove the do activity action. The name of the event The Event Specification dialog box appears. Edit the selected event. Add a new event to the subactivity state. The Event Specification dialog box appears. Remove the selected event from the subactivity state.

Detail Contains the subactivity state actions, events and buttons for editing list.

Actions group box Entry Edit Remove Exit Edit Remove Do Activity Edit Remove Name Edit Add Remove

Deferrable Events group box

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.

2005 No Magic, Inc

5-304

UML DIAGRAMS Activity Diagram

See example for flow final element notation in MagicDraw project.

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.

Object flow state


Objects that are input to or output from an action are shown as object symbols. A dashed arrow is drawn from an action state to an output object, and a dashed arrow is drawn from an input object to an action state. The same object is the output of one action and the input of one or more subsequent actions. The control flow arrows (which are solid) must be omitted when the object flow arrows (which are dashed) supply a redundant constraint. To distinguish the various appearances of the same object, the state of the object at each point is placed in brackets and appended to the name of the object. For more general information about working with symbols, see Chapter 4, "Diagrams Basics." Define the selected object flow state in the Object Flow State Specification dialog box.

5-305

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Object Flow State Specification dialog box

Figure 123 -- Object Flow 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 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. General Type Set general information about the object flow state Assign State NOTE The Assign State button is activated when the object flow states type is a classifier. Synch State Detail Contains the object flow state attributes list and buttons for editing attributes list. Actions group box Entry Edit Remove Exit The type of the entry action. The Action Specification dialog box appears. Remove the entry action. The type of the exit action

The Classifier in State Specification dialog box appears. Define a new classifier in state.

Makes an object flow state as a synch state.

2005 No Magic, Inc

5-306

UML DIAGRAMS Activity Diagram

Tab name

Box name Edit Remove Do Activity Edit Remove Name Edit Add Remove

Function The Action Specification dialog box appears. Remove the exit action. The type of the do activity action The Action Specification dialog box appears. Remove the do activity action. The name of the event The Event Specification dialog box appears. Edit the selected event. Add a new event to the object flow state. The Event Specification dialog box appears. Remove the selected event from the object flow state.

Deferrable Events group box

To open the Classifier in State Specification dialog box


1 Open the Object Flow State Specification dialog box. 2 Set the type of the object flow state by choosing the classifier from the Type

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

Figure 124 -- Classifier in State Specification dialog box

5-307

2005 No Magic, Inc.

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 Function Shows the name of the assigned state. The type of the assigned state. The name of the owner of the assigned state. The Select Model Element dialog box appears. Select a state you wish to assign. Unassign the selected state from the list. General States Set general Name information about the classifier in Type state Owner Assign Unassign

To set a classifier to an object flow state


1 Double-click the object flow state or choose Specification from the shape

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.

To assign a state to an object flow state


1 Click the Assign State button in the Object Flow State Specification dialog box.

NOTE

The Classifier in State Specification dialog box appears. 2 Type the name of the classifier in state (optional) in the Name text box. The Assign State button is activated only when a classifier is assigned to an object flow state.

Signal sending / receipt shapes


SIGNAL SENDING The sending of a signal is shown as a convex pentagon that looks like a rectangle with a triangular point on one end (it can be on either end). The signature of the signal is shown inside the symbol. (In MagicDraw, a signal signature is defined through uninterpreted transition event action.) 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. As an option, a dashed arrow can be drawn from the point on the pentagon to an object symbol to show the receiver of the signal.

To set an action to a signal sending shape


1 Double-click the signal sending shape or choose Specification from the shape

shortcut menu. The Transition Specification dialog box of the incoming transition path appears.

2005 No Magic, Inc

5-308

UML DIAGRAMS Activity Diagram

NOTE

Specify a signal sending shape in the incoming to the shape transitions specification.
2 Click the Edit button in the Effect group box. 3 The Action Specification dialog box appears. Define an action. More details

about defining actions see Section Actions on page 5-260. 4 Type an actions name directly on the signal sending shape.

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.

To set a trigger event to a signal receipt shape


1 Double-click the signal receipt shape or choose Specification from the shape

NOTE

shortcut menu. The Transition Specification dialog box of the outgoing transition path appears. Specify a signal receipt shape in the outcoming from the shape transitions specification.

2 Click the Edit button in the Trigger group box. 3 The Event Specification dialog box appears. Define an event. More details

about defining events, see . Type an events name directly on the signal receipt shape.

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

2005 No Magic, Inc.

UML DIAGRAMS Activity Diagram

Horizontal and vertical swimlanes are supported:

Also multidimentional swimlanes can be created (from the swimlane shortcut menu, choose the Insert Vertical Swimlane or Insert Horizontal Swimlane commands):

To open the Partition Specification dialog box


Choose Specification from the partition (swimlane) shortcut menu, or doubleclick the partition line.

2005 No Magic, Inc

5-310

UML DIAGRAMS Activity Diagram

Partition Specification dialog box

Figure 125 -- Partition 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 Shows the name of the activity diagram where the partition is placed. General Diagram Name Set general information about the partition Content Name Type Edit

The name of the element that contains the partition. Element type. The selected model element Specification dialog box appears.

To draw a swimlane on the diagram


Click the Swimlane button on the diagram toolbar and click the diagram.

To set a name for a swimlane


1 Double-click the swimlane line or choose Specification from the line shortcut

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

2005 No Magic, Inc.

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.

Component diagram overview


A component diagram represents a physical structure of a code (as opposed to the class diagram, which portrays the logical structure) in terms of code components and their relationships within the implementation environment. A component can be a source code component, a binary component, or an executable component. A component contains information about the logical class or classes that it implements, thus creating a mapping from a logical view to a component view. Dependencies between the components are shown, making it easy to analyze how a change in one component affects the others. Components may also be shown with any of the interfaces that they expose. Components, as with almost any other model element, can be grouped into packages, much like classes or use cases. Component diagrams are used in the later phases of the software development, when there is a need to divide up classes among different components. When working with the CASE facilities, components are used for file-class mapping during code generation, reverse engineering, and round-trip engineering operations.

Deployment diagram overview


Deployment diagrams show the physical layout of the various hardware components (nodes) that compose a system, as well as the distribution of executable programs (software components) on this hardware. Deployment diagrams are crucial when dealing with distributed systems. You may show the actual computers and devices (nodes), along with the connections they have to each other, thus specifying system topology. Inside nodes, the executable components and objects are
2005 No Magic, Inc
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

2005 No Magic, Inc.

UML DIAGRAMS Implementation Diagrams

Implementation Diagram elements


Element Component A collection of classes (or it might be one class.) Usually a component stands for a file. Component Instance (A) Button (hot key) Notation

(K)

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.

2005 No Magic, Inc

5-314

UML DIAGRAMS Implementation Diagrams

Element Node Instance

Button (hot key)

Notation

(T)

Node Instance Execution Environment Element is used for indicating that node is execution environment.

Node Instance Device

Package A group of classes and other model elements.

(P)

Interface All functionality implemented by a particular component.

(F)

Class (C)

5-315

2005 No Magic, Inc.

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. 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. Instance Deployment Spec

Button (hot key)

Notation

(B)

(I)

(SHIFT+O)

Association

(S)

Link A relationship between specification element and implementation element.

(L)

2005 No Magic, Inc

5-316

UML DIAGRAMS Implementation Diagrams

Element Generalization

Button (hot key)

Notation

(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

2005 No Magic, Inc.

UML DIAGRAMS Implementation Diagrams

Element 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.

Button (hot key)

Notation

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

2005 No Magic, Inc

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

Figure 126 -- Component Specification dialog box

5-319

2005 No Magic, Inc.

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 General Set general information about the component Box name Visibility Function Set component visibility, which defines component access level. Public. The component can be accessed by any outside object. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use this component. Private. The component can be accessed only from inside the current component. Protected. Any descendant of the component can see the component. The name of the assigned model element. Assigned model element type. The visibility of the assigned model element. By default [private]. The name of the owner of the assigned model element. The Edit dialog box appears. Edit elements name and/or visibility. The Select Model Elements dialog box appears. Select model elements you wish to assign. Remove the selected assigned model element from the component. The name of the node, which contains the current component. The type of the model element (usually node) where the current component participates. The name of the owner of the model element in which the current component participates. The Node Specification dialog box appears. The name of the artifact Denotes the type of an element that implements component. The owner of the artifact. The Artifact Specification dialog box appears. The name of the inner component. Shows that the inner element is component. The Component Specification dialog box appears. Edit the component.

Resident Name Elements Model elements Type that are Visibility assigned to the component. Owner Edit Assign Unassign Deployment Location Contains the nodes list, where the current component participates Name Type Owner

Edit Implementation Name Contains the list Type of artifacts that implement component Owner Edit Inner Components The list of the components that contains the current component. Name Type Edit

2005 No Magic, Inc

5-320

UML DIAGRAMS Implementation Diagrams

Tab name

Box name Add Remove

Function The Component Specification dialog box appears. Define the component. Remove the selected component.

To assign classes, interfaces, and/or collaborations to the component


1 Double-click the component shape or choose Specification from the

components shortcut menu. The Component Specification dialog box appears. 2 Click the Resident Elements tab. 3 Click the Assign button. The Select Model Element dialog box appears. Select model elements you wish to assign to a component. 4 A component can be represented as both types and instances. The type and instance dichotomy is the same for a class and an object. Component types can be regarded as a class, while component instances are types of objects. The names for component instances are underlined.

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

2005 No Magic, Inc.

UML DIAGRAMS Implementation Diagrams

Node Specification dialog box

Figure 127 -- Node 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 Visibility Set general information about the node

Public. The node can be accessed by any outside model element. Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that node. Private. Only the node itself, or elements nested within that node can see it. Protected. Classifiers derived from that node may see it.

Deployed Components Assign components to a node

Name Type Owner Edit Assign Unassign

The name of the assigned component. The type of the assigned component. The name of the owner of the assigned component. The Component Specification dialog box appears. Edit the selected component in the dialog box. The Select Model Element dialog box appears. Select a component you want to assign. Remove the selected component from the node.

To assign/edit/remove components to/of the node


1 Double-click the node shape or choose Specification from the node shortcut

menu. The Node Specification dialog box appears.

2005 No Magic, Inc

5-322

UML DIAGRAMS UML Extension Mechanisms

2 Click the Resident Components tab.

To assign a component, click the Assign button. The Select Model Element screen appears. Select a node you wish to assign to the node. To edit a component, assigned to a node, click the Edit button. The Component Specification dialog box appears. To remove the assigned component from the node, click the Unassign button.

NOTE

After assigning components to a node, those components will not be shown on the diagram pane as assigned to the node. You may add those components to the node by drag-and-drop operation.

UML EXTENSION MECHANISMS

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.

To open the Stereotype Specification dialog box

Double-click the stereotype shape or choose Specification from the stereotype shortcut menu.

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

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

STEREOTYPE SPECIFICATION

DIALOG BOX

Figure 128 -- 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 Function 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. The list of the selected model elements for which the current stereotype can be assigned. The name of the affected model element. The type (class, use case, etc.) of that model element. The name of the owner (package, subsystem, or model) of the affected model element. The corresponding model element's Specification dialog box appears. General Icon Set general information about the stereotype. Remove Base Classes All The list of model > elements to which the stereotype can be applied. < >> << Selected Extended Elements Name Shows the model Type elements affected by the stereotype. Owner Edit

2005 No Magic, Inc

5-324

UML DIAGRAMS UML Extension Mechanisms

Tab name Defined Tags

Box name Name Type Edit Add Remove

Function The name of the tag definition. The type of the tag. It can be any model element. The Tag Definition Specification dialog box appears. Edit the selected tag definition. The Tag Definition Specification dialog box appears. Define a new tag definition. Removes the selected tag.

To create a new stereotype

Use the Stereotype button on the class diagram toolbar.

1 From the base class shortcut menu in the Browser, Model Extensions Tree,

NOTE

choose New, and then choose Stereotype. -orFrom the Tools menu, choose Profiles. Choose the desired profile and then open the Stereotypes tab. Click the Add button 2 The Select Extension Elements Storage dialog box appears. Click OK and specify a new stereotype in the Stereotype Specification dialog box. For a detailed description of this dialog box, see Section Stereotype Specification dialog box on page 5-324. You may open the Edit Stereotypes dialog box from the element Specification dialog box.

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.

To create a stereotype with an image


1 From the Tools menu, choose Profiles. Choose the desired profile and then

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.

To display a stereotype icon, as a main shape, on the diagram pane


From the shape, that has an assigned stereotype with an icon, shortcut menu, choose Suppress Content.
2005 No Magic, Inc.

5-325

UML DIAGRAMS UML Extension Mechanisms

In the table below, there are listed all predefined stereotypes for model elements.
NOTE

The table contains also stereotypes that are imported from the <MagicDraw installation directory>/Stereotypes folder.
DIALOG BOX,

PROFILES

STEREOTYPES

TAB

To open the Profiles 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.

Figure 129 -- Profiles dialog box. Stereotypes tab

The Edit Stereotypes dialog box contains the following elements.


Element name Function For Contains the names of model elements to which stereotypes apply (base classes.)

2005 No Magic, Inc

5-326

UML DIAGRAMS UML Extension Mechanisms

Element name Function Available Edit Add Remove Contains stereotypes that apply to the selected model element. Edit the selected stereotype in the Stereotype Specification dialog box. The Stereotype Specification dialog box appears. Add a new stereotype to the selected model element. Deletes the selected stereotype. NOTE If you remove the predefined stereotype, that removed stereotype will be automatically imported after loading project for the next time. Saves all actions performed during the session and exits the dialog box. Cancels all actions performed during the session and exits the dialog box. Displays the MagicDraw Help.

OK Cancel Help

UML WEB EXTENSION STEREOTYPES This Web extension to the UML defines a set of stereotypes, tagged values and constraints that enable us to model Web applications. The stereotypes and constraints are applied to certain components that are particular to Web applications and allows us to represent them in the same model, and on the same diagrams that describe the rest of the system. The principal element specific to Web applications is the Web page. There are several stereotypes that can be applied to a Web page, and additional stereotypes are assigned to other elements of HTML that represent architecturally significant components of the system (frames, targets and forms).

5-327

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Server Page Stereotype


Metamodel Class Description Class 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

Client Page Stereotype


Metamodel Class Description Class An instance of a client page is an HTML formatted Web page. Like any HTML page it is a mix of data, presentation and even logic. Client pages are rendered by client browsers, and may contain scripts that are interpreted by the browser. Client page functions map to functions in scripts tags in the page. Client page attributes map to variables declared in the pages script tags that are accessible by any function in the page (page scoped). Client pages may have the associations relations with other pages, client or server.

Icon

Form Stereotype
Metamodel Class Description Class 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

2005 No Magic, Inc

5-328

UML DIAGRAMS UML Extension Mechanisms

Frame Set Stereotype


Metamodel Class Description Class A frame set is a container of multiple Web pages. The rectangular viewing area is divided up into smaller rectangular frames. Each frame may be associated with a single frame named target, although not necessarily. The contents of a frame may be a Web page or another frame set. A frame set stereotyped class maps directly to a frameset Web page, as well as the HTML frame tag. Because a frameset is a client page, it may have operations and attributes; browsers that do not render frames activate them.

Icon

Target Stereotype
Metamodel Class Description Class A target is a named compartment in a browser window in which Web pages can be rendered. The name of the stereotyped class is the name of the target. Typically a target is one frame in a window defined by a frameset. However, a target could be a completely new browser instance or window. Targeted link associations specify targets as the place where a new Web page is to be rendered.

Icon

JavaScript Stereotype
Metamodel Class Description Icon Class On a JavaScript enabled browser it is possible to simulate userdefined objects with JavaScript functions.

Link Stereotype
Metamodel Class Association

5-329

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Description

A link is a pointer from a client page to another Page. In a class diagram a link is an association between a client page and either another client page or a server page. A Link association maps directly to the HTML anchor tag. None

Icon

2005 No Magic, Inc

5-330

UML DIAGRAMS UML Extension Mechanisms

Targeted Link Stereotype


Metamodel Class Description Association Similar to a link association, a targeted link is a link where the associated page is rendered in another target. This association maps directly to the HTML anchor tag, with the target specified by the tag target attribute. None

Icon

Frame Content Stereotype


Metamodel Class Description Association A frame content association is an aggregation association expressing a frame containment of another page or target. A frame content association can also point to another frameset, indicating nested frames. None

Icon

Submit Stereotype
Metamodel Class Description Association A submit association is always between a form and a server page. Forms submit their field values to the server through server pages for processing. The Web server processes the server page, which accepts and uses the information in the submitted form. This relationship indicates which page (or pages) is able to process the form, and which forms a server page. None

Icon

Builds Stereotype
Metamodel Class Description Association The builds relationship is a special relationship that bridges the gap between client and server pages. Server pages only exist on the server. They are used to build client pages. The builds association identifies which server page is responsible for the creation of a client page. This is a directional relationship, since the client page contains no knowledge of how it came into existence. A server page can build multiple client pages, but a client page can only be built by one server page. None

Icon

Redirect Stereotype
Metamodel Class Association

5-331

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Description

A redirect relationship is a unidirectional association with another Web page. It can be directed both from and to client and server pages. If the relationship originates from a server page then it indicates that the processing of the page request may continue on with the other page. This does indicate that destination page always participates in the building of a client page, only that it could. This particular relationship is not completely structural, since the actual invocation of a redirection operation must be done programmatically in the code of the originating page. If the relationship originates from a client page then this indicates that the browser automatically requests the destination page, without user input. A time delay value can be set that specifies a delay (in seconds) before the second page is requested. This use of redirection corresponds to the META tag and HTTPEQUIV value of "Refresh". None

Icon

2005 No Magic, Inc

5-332

UML DIAGRAMS UML Extension Mechanisms

Object Stereotype
Metamodel Class Description Association An association between a client page and an object that is embedded in it. The object is typically a Java Applet or ActiveX control. This association maps in part to the HTML <object> tag. None

Icon

IIOP Stereotype
Metamodel Class Description Association IIOP (Internet Inter-Orb Protocol) is a special type of relationship between objects on the client and objects on the server. It represents a communication mechanism other than HTTP for client server communications. Typically this relationship is between Java Beans on the client and Enterprise Java Beans on the server. None

Icon

RMI Stereotype
Metamodel Class Description Association RMI (Remote Method Invocation) is a mechanism for Java Applets and Beans to send messages to other Java Beans on different machines. Typically this relationship is between Java Beans or Applets on the client and Enterprise Java Beans on the server. None

Icon

Input Element Stereotype


Metamodel Class Description Attribute An Input Element is an attribute of a Form object. It maps directly to the <input> tag in an HTML form. It is used to input a single word or line of text. The tagged values associated with this stereotyped attribute correspond to the <input> tag attributes. To complete the required values for the HTML tag; the attribute name is used as the <input> tag name, and the attributes initial value is the tag value. None

Icon

Select Element Stereotype


Metamodel Class Description Attribute 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

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Icon

None

TextArea Element Stereotype


Metamodel Class Description Icon Attribute An input control used in forms that allows multiple line input. None

Page Stereotype
Metamodel Class Description Component A page component is a Web page. A browser may request it by name. A Page component may or may not contain client or server scripts. Typically Page components are text files accessible by the Web server, but they can also be compiled modules that are loaded and invoked by the Web server. Ultimately, when accessed by the Web server (as either a file or executable) a page produces an HTML formatted document that is sent in response to a browsers request.

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.

2005 No Magic, Inc

5-334

UML DIAGRAMS UML Extension Mechanisms

TAG DEFINITION SPECIFICATION

DIALOG BOX

To open the Tag Definition Specification dialog box

In the Profiles dialog box, Tag Definitions tab, click the Add or Edit button.

Figure 130 -- Tag Definition 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 General Set general information about the tag definition Box name Name Function Type the name of the tag definition.

Multiplicity

Specifies the number of data values that tagged values based on this tag must have, or, the number of model elements that can be associated to the related tagged values. 0 - zero and only zero. 1 - one and only one. 0..1 - zero or one. 0..* - from zero to any positive integer. 1..* - from one to any positive integer. * - any positive integer. In the general case, where the tag type is a data type, this specifies the range of values of the tagged values associated with the tag definition. In the special case, where the tag type refers to a metaclass that is not a data type, the tag value references model elements that are instances of the metaclass.

Type

5-335

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Tab name

Box name Default Value Show In Diagrams

Function The default value of the tag definition. Shows tag definition on Diagram pane.

Base Classes Typed Values The tagged values that conform to this tag definition.

Select base classes you want to assign to the current tag definition from the All list to the Selected list Value Owner Edit The name of the tagged value. The name of the owner of that value. The Tagged Value Specification dialog box appears.
DIALOG BOX

TAGGED VALUE SPECIFICATION

To open the Tagged Value Specification 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.

Figure 131 -- Tagged Value Specification

2005 No Magic, Inc

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 Function

General Tag Definition Set general information about the tagged value HTML Value Edit Add Remove

Tag definition that specifies the tagged value. The Tag Definition Specification dialog box appears. Set tagged value text as HTML. The list of values. Edit the selected value. Adds a value. Removes the selected value.

To define a new tag definition


1 From the base class shortcut menu in the Browser, Model Extensions Tree,

choose New, and then choose Tag Definition. -orFrom the Tools menu, choose Profiles and then Tag Definitions tab. Click the Add button. 2 The Select Extension Elements Storage dialog box appears. Select a package, click OK and specify a new tag definition in the Tag Definition Specification dialog box. For a detailed description of this dialog box, see Section Tag Definition Specification dialog box on page 5-335. Click the Tagged Values tab in the Specification dialog box for each model element and click the ... button. The Profiles dialog box, Tag Definitions tab appears. Define a name and value.

To import/export tag definition


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. PROFILES
DIALOG BOX,

TAG DEFINITIONS

TAB

To open the Profiles dialog box, Tag Definitions tab

From the Tools menu, choose Profiles, then Tag Definitions tab, and then click Edit.

5-337

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

In the elements Specification dialog box, Tagged Values tab, click the Edit Tag Definitions button.

Figure 132 -- Edit Tag Definitions dialog box

Element name For Available Edit Add Remove OK Cancel Help

Function Contains the names of model elements to which defined tag definitions apply. Contains tag definitions that apply to the selected model element. Edit the selected tag definitions in the Tag Definition Specification dialog box. The Tag Definition Specification dialog box appears. Add a new tag definition to the selected model element. Deletes the selected tag definition. Attaches the selected tag definition to the particular element and exits the dialog box. Cancels all actions performed during the session and exits the dialog box. Displays the MagicDraw Help.

2005 No Magic, Inc

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.

To add a TODO task


1 2 3 4

Open the element Specification dialog box, Tagged Value tab. Click the Add button and choose TODO from the list. Type the desired text in the Value text box. Click OK.

To display TODO tasks


1 From the Edit menu, choose Find TODO. 2 All model elements that contain TODO items will be displayed in the Browser,

Search Results tree. 3 To open the desired model element on the Diagram pane, double-click it in the From Diagrams tree or choose Go To from element shortcut menu. GROUPS
1 Create the desired profile (e.g. My Profile). 2 Create enumeration data type with the desired name (e.g. My Groups) in the 3 4

5 6 7

already created profile. Add enumeration literals to the created enumeration (e.g. 1 group, 2 group). Create a tag definition named Group: from the Tools menu, choose Profiles and in the Profiles dialog box, Tag Definitions tab. In the Profiles drop-down list box choose your created profile My Profile and choose Tag Definition as an element for which you would like to create a tag definition, click Add. In the Extension Element Storage dialog box, select the created profile (in this case My Profile) and click OK. The tag definition will be created in it. Define to the created tag definition Type as Enumeration My Groups. Open the Stereotypes tab and set the stereotype TagGroup. Create other tag definitions for any base class element. For example Author and in the set Tag definition as Groups. Then create a tagged value for it and choose from the list 1 group or 2 group.

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

2005 No Magic, Inc.

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 specify invariants on classes and types in the class model. To specify type invariant for Stereotypes To describe pre- and post conditions on Operations and Methods To describe Guards As a navigation language To specify constraints on operations

Edit constraints in the Constraints tab of model element Specification dialog box.

To define a new constraint


1 From the base class shortcut menu in the Browser, Model Extensions Tree,

choose New, and then choose Constraint. -orFrom the Tools menu, choose Profiles and then Edit Constraints tab. Click the Add button. -orClick the Constraints tab in the Specification dialog box for each model element and click the ... button. The Profiles dialog box, Constraints tab appears. Click the Add button. 2 The Select Extension Elements Storage dialog box appears. Select a package, click OK and specify a new constraint in the Constraint Specification dialog box. For a detailed description of this dialog box, see Section Constraint Specification dialog box on page 5-341. Click the Constraints tab in the Specification dialog box for each model element and click the Add button. Type the name and the expression of the constraint.

2005 No Magic, Inc

5-340

UML DIAGRAMS UML Extension Mechanisms

CONSTRAINT SPECIFICATION

DIALOG BOX

To open the Constraint Specification dialog box


In the Edit Constraints dialog box, click the Add or Edit button.

Figure 133 -- 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 Enter the name of the constraint. Enter an expression of the constraint. If selected, the expression is checked according Object Constraint Language (OCL) 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. The list of the selected model elements for which the current constraint can be assigned. 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

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

Tab name Constrained Elements The list of elements subject to the constraint

Box Name Type Edit

Function The name of the model element to which the current constraint is assigned. The type of the model element to which the current constraint is assigned. The Specification dialog box of the selected model elements appears.

PROFILES DIALOG BOX, CONSTRAINTS TAB In the Constraints tab of the Profiles dialog box, define common constraints for your project. Later you may attach them to the particular model element.

To open the Profiles dialog box, Constraints tab


From the Tools menu, choose Profiles and then Constraints tab. Click the ... button in the elements Specification dialog box, Constraints tab.

Figure 134 -- Profiles dialog box. Constraints tab

2005 No Magic, Inc

5-342

UML DIAGRAMS UML Extension Mechanisms

The Constraints tab of the Profiles dialog box contains the following elements.
Element name For Available Edit Add Remove OK Cancel Help Function Contains the names of model elements to which defined constraints apply. Contains constraints that apply to the selected model element. Edit the selected constraints in the Constraint Specification dialog box. The Constraint Specification dialog box appears. Add a new constraint to the selected model element. Deletes the selected constraint. Attaches the selected constraint to the particular element and exits the dialog box. Exits the dialog box without saving changes. Displays MagicDraw UML Help.

5-343

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-344

UML DIAGRAMS UML Extension Mechanisms

5-345

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-346

UML DIAGRAMS UML Extension Mechanisms

5-347

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-348

UML DIAGRAMS UML Extension Mechanisms

5-349

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-350

UML DIAGRAMS UML Extension Mechanisms

5-351

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-352

UML DIAGRAMS UML Extension Mechanisms

5-353

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-354

UML DIAGRAMS UML Extension Mechanisms

5-355

2005 No Magic, Inc.

UML DIAGRAMS UML Extension Mechanisms

2005 No Magic, Inc

5-356

EXTENSION DIAGRAMS
MagicDraw supports an extension to UML diagrams:

Content diagram Robustness diagram Time diagram Web diagram CORBA IDL diagram DDL diagram WSDL diagram XML Schema diagram

Also MagicDraw provides various types of other diagrams:


Working with Diagrams


General information about working with diagrams see in Chapters Diagrams Basics and UML Diagrams. In the Environment Options dialog box, Plugins pane, you may select what extension diagrams you want to be enabled or disabled.

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.

To open the Pattern Wizard


In the class diagram, click the Class by Pattern button. 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.

2005 No Magic, Inc.

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

2005 No Magic, Inc.

EXTENSION DIAGRAMS Content Diagram

Content Diagram Elements


Toolbar Button 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) Button (Hot key) Notation

2005 No Magic, Inc

6-360

EXTENSION DIAGRAMS Content Diagram

Toolbar Button Content Shape Creates a table of contents of all diagrams of the project.

Button (Hot key)

Notation

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

2005 No Magic, Inc.

EXTENSION DIAGRAMS Content Diagram

Toolbar Button State Diagram Creates a state diagram.

Button (Hot key)

Notation

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.

2005 No Magic, Inc

6-362

EXTENSION DIAGRAMS Robustness Diagram

Toolbar Button Robustness Diagram Creates a robustness diagram. DDL Diagram Creates a DDL diagram.

Button (Hot key)

Notation

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. Entity objects are usually objects from the domain model. 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

2005 No Magic, Inc.

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 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. Button (Hot key) Notation

(A)

2005 No Magic, Inc

6-364

EXTENSION DIAGRAMS Web Diagram

Toolbar Button/Model Element Boundary Actors use boundary objects to communicate with the system (sometimes called interface objects.) Class with stereotype boundary 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. Separator

Button (Hot key)

Notation

(B)

(C)

(E)

(S)

(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

2005 No Magic, Inc.

EXTENSION DIAGRAMS Web Diagram

Reference: Building Web Applications with UML by Jim Conallen Copyright 2000 by Addison Wesley Longman, Inc.

2005 No Magic, 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) Button (Hot Some examples key)

6-367

2005 No Magic, Inc.

EXTENSION DIAGRAMS Web Diagram

Toolbar Button/Model Element Client Page

Button (Hot Some examples key)

(SHIFT+C)

Server Page (SHIFT+S)

Form

(SHIFT+F)

Frame

(SHIFT+E)

Target

(SHIFT+T)

Java Script (SHIFT+J)

Class (C)

2005 No Magic, Inc

6-368

EXTENSION DIAGRAMS Web Diagram

Toolbar Button/Model Element Interface

Button (Hot Some examples key)

(I) Package (P) Subsystem (Y) Model (M) Realize (R) Realization (E) Dependency (D) Generalization (G) Association (S) Aggregation A Composition (F)

6-369

2005 No Magic, Inc.

EXTENSION DIAGRAMS Web Diagram

Toolbar Button/Model Element Builds

Button (Hot Some examples key)

(B)

Link (L)

Targeted Link (SHIFT+L)

Frame Content (SHIFT+O)

Submit (U)

Object (O) RMI (SHIFT+R) IIOP (SHIFT+I)

2005 No Magic, Inc

6-370

EXTENSION DIAGRAMS CORBA IDL Diagram

Toolbar Button/Model Element Page

Button (Hot Some examples key)

(SHIFT+P)

Separator (W)

CORBA IDL DIAGRAM


CORBA IDL diagram facilitates the creation of CORBA IDL elements. Also the following patterns are available for CORBA IDL: Interface, Value Type, Type Definition, Sequence, Array, Fixed, Union, Enumeration, Struct, Exception. More information about CORBA IDL usage in MagicDraw, find in the MagicDraw Code Engineering Users Guide, Chapter CORBA IDL Mapping to UML. Reference: UMLTM Profile for CORBATM Specification, Version 1.0, April 2002. http://www.omg.org/technology/documents/formal/profile_corba.htm

6-371

2005 No Magic, Inc.

EXTENSION DIAGRAMS CORBA IDL Diagram

CORBA IDL Diagram Elements


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) CORBA IDL Module (M) Button (Hot key)

2005 No Magic, Inc

6-372

EXTENSION DIAGRAMS CORBA IDL Diagram

Toolbar Button/ Model Element CORBA IDL Interface

Button (Hot key)

(I) CORBA IDL Value (V) Class by Pattern The Pattern Wizard appears. SHIFT+P Generalization (G) Truncatable Generalization

Value Support Generalization

CORBA IDL Association

Association (S) Aggregation (A) Composition (F) Package (P)

6-373

2005 No Magic, Inc.

EXTENSION DIAGRAMS DDL Diagram

Toolbar Button/ Model Element Class

Button (Hot key)

(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.

2005 No Magic, Inc

6-374

EXTENSION DIAGRAMS DDL Diagram

DDL Diagram Elements


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) Table (T) Button (Hot key)

6-375

2005 No Magic, Inc.

EXTENSION DIAGRAMS WSDL Diagram

Toolbar Button/ Model Element View

Button (Hot key)

(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.

2005 No Magic, Inc

6-376

EXTENSION DIAGRAMS WSDL Diagram

WSDL Diagram Elements


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) WSDLmessage (M) Button (Hot key)

6-377

2005 No Magic, Inc.

EXTENSION DIAGRAMS WSDL Diagram

Model Element WSDLporttype

Button (Hot key)

(T) WSDLbinding (B) WSDLport (SHIFT+P) WSDLservice (S) WSDLdefinitions (D) WSDLtypes (Y) WSDLimport (I) Xmlns (SHIFT+L) XDSnamespace (P) Realization (E) Separator (W)

2005 No Magic, Inc

6-378

EXTENSION DIAGRAMS XML Schema Diagram

XML SCHEMA DIAGRAM


Diagram purpose is to create structure of xml schema file. Diagram allows quick draw of xml schema elements. These elements are stereotyped UML elements from class and implementation diagrams. Also the following patterns are available for XML Schema: XSDcomplexType, XSDcomposition, XSDsimpleType, XSDsimpleType(XSDlist), XSDsimpleType(XSDunion), and Simple XSDrestriction. The detailed description about XML Schema usage in MagicDraw, see MagicDraw Code Engineering Users Guide, Chapter XML Schema. Reference: http://www.w3.org/TR/xmlschema-2/

6-379

2005 No Magic, Inc.

EXTENSION DIAGRAMS XML Schema Diagram

XML Schema Diagram Elements


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) Class by Pattern (SHIFT+P) XSDcomplexType (C) Button (Hot key)

2005 No Magic, Inc

6-380

EXTENSION DIAGRAMS XML Schema Diagram

Toolbar Button/ Model Element XSDsimpleType

Button (Hot key)

(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

2005 No Magic, Inc.

EXTENSION DIAGRAMS Time Diagram

Toolbar Button/ Model Element Aggregation

Button (Hot key)

(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

2005 No Magic, Inc

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 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>> Button (Hot key)

6-383

2005 No Magic, Inc.

EXTENSION DIAGRAMS Time Diagram

Toolbar Button/ Model Element Classifier Role <<SAshedRes>>

Button (Hot key)

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

2005 No Magic, Inc

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. Package Overview Diagram Wizard generates the package dependency diagram for packages in your project. Tools for Analysis prepares diagrams and report documents of the relationships between classes in the UML model.

Hierarchy Diagram Wizard Realization Diagram Wizard

Content Diagram Wizard - generates content of diagrams that are used in the project. Sequence Diagram from Java Source Wizard - creates sequence diagram of Java method implementation. 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. Implementing or Overriding Operations creates defined operations down the inheritance tree. 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. Metrics - allows measuring project by different viewpoints.

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.

2005 No Magic, Inc.

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.

To open the Report dialog box


Choose the Report command from the Tools menu. The Report dialog box appears.

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

2005 No Magic, Inc.

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.

Figure 135 -- Report dialog box. Template Management tab

The following report templates are available:

Model Report. Describes your UML model from different viewpoints, which are already predefined in MagicDraw or you may create your own. Predefined templates:

Behavioral Model Report. Includes behavioral elements in the report: class diagram elements, collaboration, activity, and state diagrams and their elements. Built-In. Includes all available model elements into the report. Static Model Report. Includes class and implementation diagrams elements.

Use Case Report. Describes system functionality and actors. UC report is generated from tag definition values, which are listed in UC profile.

2005 No Magic, Inc

7-388

TO O L S Reports

NOTE: Use Case report requires specifying model enrichment information (model actors and top-level UC diagrams).

Software Design Description. Describes software design of your system. The document includes sections that describe software design goals, strategies, constraints and guidelines, system architecture and detailed design. NOTE: Software Design Description report requires specifying model enrichment information. Model Extension Report. Describes common UML model extension mechanisms (stereotypes, tagged values and constraints).

To create your own report template


1 In the left pane of the Report dialog box, select Model Report, Use Case

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template, according which, you would like to create your own template and click the Clone button. 3 The Enter Style Name dialog box appears. Type the name of the new template and click OK. 4 Double click the newly created report template and specify its options in the appeared tabs.

To rename the selected report template


1 In the left pane of the Report dialog box, select Model Report, Use Case

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template and click the Rename button. 3 Type the new name in the Enter Style Name dialog box.

To delete the selected report template


1 In the left pane of the Report dialog box, select Model Report, Use Case

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template and click the Delete button.

Import the desired report template


1 In the left pane of the Report dialog box, select Model Report, Use Case

NOTE

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, click the Import button. 3 The Open dialog box appears. Choose the template you want to import and click Open. All MagicDraw report templates (*.rst) are located in the <MagicDraw installation directory>/data/report/report_types.

7-389

2005 No Magic, Inc.

TO O L S Reports

Export the selected report template


1 In the left pane of the Report dialog box, select Model Report, Use Case

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template you want to export and click the Export button. 3 The Save dialog box appears. Select the directory where you want to save the selected template and click Save.

Set the selected report template as default


1 In the left pane of the Report dialog box, select Model Report, Use Case

Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template you want to set as default and click the Make Default button.

2005 No Magic, Inc

7-390

TO O L S Reports

DOCUMENT OPTIONS
Property Name Report Title Document Title Company Name Footer Text Show Revision History Revision History Table Rows Revision Number Revision Details Revision Author Show Number of Total Pages Table of Contents Location
Only for model report, use case report, and software design description.

Description The general title of the report. By default, the name of the report template is given. The title of the generated document. The name of the company. Text that will be displayed in the footer of the document. If True, shows the table of revision history. Specify the number of rows in the revision history table. Enter the number of the revision. Specify the status of the revision. By default - Initial Version. Type that name of the author. Select this check box, if you want that the number of pages will be displayed as e.g. 5-26. Choose the place where the table of contents will be placed: Beginning of the Document, End of the Document, Not Included. In the table of contents, the list of hyperlinks of generated elements that represent classes, packages and diagrams. The hierarchy of the contents is listed top down: from packages to the elements that are included into the packages. Documentation is generated in html format (available only in HTML output reports) Includes documentation of the model elements in the generated report. Includes the location (parent element) of the model element in the model dictionary index. Includes UML model dictionary table to the report. Documentation is shown as it is entered. If not selected, documentation text is wrapped Documentation has line breaks, even if the Preformatted Documentation is not selected. It has no effect is Documentation as HTML is selected.

Documentation as HTML
Only for model report.

Include Documentation
Only for model report.

Include Full Descriptions


Only for model report.

Include Model Dictionary


Only for model report.

Preformatted Documentation
Only for model report.

Preserve Line Breaks


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.

Show Purpose Section


Only for use case report, software design description, and model extension report.

Includes Purpose subsection in the Introduction section.

7-391

2005 No Magic, Inc.

TO O L S Reports

Property Name Document Purpose


Only for use case report, software design description, and model extension report.

Description Type the purpose of the generated document. This text will be included in the Purpose subsection. Includes Scope subsection in the Introduction section.

Show Scope Subsection


Only for use case report, software design description, and model extension report.

Document Scope
Only for use case report, software design description, and model extension report.

Type the scope of the generated document. This text will be included in the Scope subsection. Includes Overview subsection in the Introduction section.

Show Overview Subsection


Only for use case report and software design description.

Document Overview
Only for use case report and software design description.

Type an overview of the generated document. This text will be included in the Overview subsection. Includes a text This document is generated by MagicDraw UML in the footer.

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.
Function (if True) Includes activity diagrams in the generated report. Includes all available actors in the generated report. Includes artifact report. Includes all available attributes in the generated report. Includes all available classifiers in the generated report. Includes all available classes in the generated report. Includes collaboration diagrams in the generated report. Includes all available comments in the generated report. Includes all available components in the generated report.

Element name Activity Diagram Actor Artifact Attributes Classifier Role Class Collaboration Diagram Comment Component

2005 No Magic, Inc

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 (if True) Includes all available component instances in the generated report. Includes all available constraints in the generated repor.t Includes all available data types in the generated report. Includes all available enumerations in the generated report. Includes all available enumeration literals in the generated report. Includes all available use case extension points in the generated report. Includes all available instances in the generated report. Includes all available interfaces in the generated report. Includes all available nodes in the generated report. Includes all available node instances in the generated report. Includes all available operations in the generated report. Includes relationships in the generated report. Includes sequence diagrams in the generated report. Includes all available signals in the generated report. Includes state diagrams in the generated report. Includes all available stereotypes in the generated report. Includes tag definitions in the generated report. Includes all available use cases in the generated report.

Model Elements Options In the Model Elements Options tab you may define general options how the model elements will be described in the report.
Option name Filter By Visibility Function Only operations and attributes with the selected type of visibility are included in the report. Possible choices: All, Public, Not Private. Includes Stereotypes section when describing an element. Includes Tagged Values section when describing an element. Includes Constraints section when describing an element. Includes Hyperlinks section when describing an element. Includes Relations section when describing an element. You may choose to show only associations. Includes the Leaf section, informing if the described element is leaf.

Show Stereotypes Section Show Tagged Values Section Show Constraints Section Show Hyperlinks Section Show Relations Section Show Leaf

7-393

2005 No Magic, Inc.

TO O L S Reports

Option name Show Root Show Abstract Show Attributes Section Show Operations Section Show Inner Elements Section Show Inner Relations Section

Function Includes the Root section, informing if the described element is root. Includes the Abstract section, informing if the described element is abstract. Includes Attributes section when describing an element. Includes Operations section when describing an element. Includes Inner Elements section when describing an element. Includes Inner Relations section when describing an element.

Show Template Parameters Includes Template Parameter section when describing an Section element.

USE CASE REPORT Use Case Report describes systems functionality and actors. UC report is generated from tag definition values, which are listed in UC profile. Use Case report requires specifying model enrichment information - the defining of model actors and top-level UC diagrams - in the Use Case Model Wizard. Use Case Model Wizard Use Case Model Wizard is used for predefining the specific diagrams that describe different views of the use case model:

Actors diagrams describes actors relationships in the system. Use case model diagrams represents use case model of the system.

These a

To open the Use Case Model Wizard


From the Tools menu, choose Use Case Model Enrichment. 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 Use Case Model Section Show Package Details Function (if true) Includes the description of actors in the report. Includes the description of use case model in the report. Includes the information of packages.

2005 No Magic, Inc

7-394

TO O L S Reports

Use Case Options In this list select tag definitions you want include in the report. Navigate with buttons on the right. SOFTWARE DESIGN DESCRIPTION Software Design Description report describes software design of your system. The document includes sections that describe software design goals, strategies, constraints and guidelines, system architecture and detailed design. This report is modeled according RUP , with some modifications. Software Design Description report requires specifying model enrichment information, where you select diagrams, depicting software design views. Model Options Software Design Description report contains the following sections and subsections that you may choose to be included:
1 Introduction
1.1 Purpose

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 Option name Show System Overview Section System Overview Function Includes System Overview section in the report. Click the ... button and type the text you want to be displayed in the System Overview section.

7-395

2005 No Magic, Inc.

TO O L S Reports

Option name Show Design Consideration Section Show Dependencies Subsection System Dependencies Show Constraints Subsection System Constraints Show Goals Subsection System Goals Show Architectural Strategies Section Architectural Strategies Show System Architecture Section Show Use Case View Subsection Show Conceptual View Subsection Show Deployment View Subsection

Function Includes Design Considerations section in the report. Includes Assumptions and Dependencies subsection in the report. Click the ... button and type the text you want to be displayed in the Dependencies section. Includes Constraint subsection in the report. Click the ... button and type the text you want to be displayed in the System Overview section. Includes Goals subsection in the report. Click the ... button and type the text you want to be displayed in the Goals section. Includes Architectural Strategies section in the report. Click the ... button and type the text you want to be displayed in the Strategies section. Includes System Architecture section in the report. Includes Use Case View subsection in the report. Select the diagrams that represent Use Case View in the Software Design Model Wizard. Includes Conceptual View subsection in the report. Select the diagrams that represent Conceptual View in the Software Design Model Wizard. Includes Deployment View subsection in the report. Select the diagrams that represent Deployment View in the Software Design Model Wizard.

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 Includes Design Model subsection in the report. Select the diagrams that represent Design Model View in the Software Design Model Wizard. Includes subsection in the report. Select the diagrams that represent Design Model View in the Software Design Model Wizard. Includes the description of classes of the subsystem. Includes Functionality and Processing section in the subsystems description. Includes detailed description of actions, performed by subsystem.

Show Subsystem Details Section Show Subsystem Classes Show Subsystem Process Show Subsystem Actions

2005 No Magic, Inc

7-396

TO O L S Reports

Option name Show Subsystem Interactions Show Subsystem Resources Show Implementation Model

Function Includes Uses/Interactions section in the description of subsystem. Includes Resources section in the description of subsystem. Includes Implementation Model subsection in the report. Select the diagrams that represent Implementation View in the Software Design Model Wizard.

MODEL EXTENSION REPORT Model Extension report describes common UML model extension mechanisms (stereotypes, tagged values and constraints) of your project.
Property name Show Stereotypes Stereotypes Table Style Show Tag Definitions Show Global Tag Definitions Function (if true) Includes stereotypes description in the report. Choose table style of the description of stereotypes: Simple or Extended. Includes tag definitions description in the report. Include default tag definitions.

7-397

2005 No Magic, Inc.

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.

Figure 136 -- Report dialog box. Select Packages tab

2005 No Magic, Inc

7-398

TO O L S Reports

Select Diagrams tab


From the Select Diagrams tab, select diagrams from which images are added to the report. By default, no diagrams are selected.

Figure 137 -- Report dialog box. Select Diagrams tab

Include All Diagrams includes all available diagrams in the report. Include Selected Diagrams allows to choose the diagrams you want to include in the report.

7-399

2005 No Magic, Inc.

TO O L S Reports

Output Options tab

Figure 138 -- Report dialog box. Output Options tab

Element name Report File

Function 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.

2005 No Magic, Inc

7-400

TO O L S Reports

Element name Report Output Format

Function Select the type of the report you want to be displayed: HTML Browsable (*.html) Generates a report that is easy to browse. With the browsable table of contents, you may easily find information you want on different pages. NOTE: HTML report is not available for Use Case Report, Software Design Description, and Model Extension Report. HTML Printable (*.html) Generates a report on one screen. You may easily print and analyze printed report. NOTE: HTML report is not available for Use Case Report, Software Design Description, and Model Extension Report. XSL Formatting Objects (*.fo) Portable Document Format (*.pdf) Post Script (*.ps) Rich Text Format (*.rtf) Choose the size or paper for all reports, excluding HTML reports. Choose the Portrait or Landscape page orientation for all reports, excluding HTML reports. Generates the report according to the appropriated options. Creates report.properties file according to options specified in the Report Wizard. Choose the directory where you want to save this file. This file is used for generating reports from console.The description about Report Generator tool, see in Section Report Generator Tool on page 7-404. After the generation, the generated report is opened in the corresponding viewer. 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. Import already created report configuration. Closes and exits the Report dialog box. Displays MagicDraw Help.

Report Paper Size Page Orientation Generate Export

Display in Viewer Save 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

2005 No Magic, Inc.

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

<MD_install_dir> is MagicDraw installation directory, <reportType> - report type name, <reportStyle> - report style name, <outputFormat> - report output format has three possible values (HTML_BROWSABLE, HTML_PRINTABLE and XSL_FO).
Report Style Default Default Default Custom Output Format "Main.xsl" file location directory (under "<MagicDraw install dir>/data/report/report_types" directory) Model Report/xsl/Default/HTML_BROWSABLE Model Report/xsl/Default/HTML_PRINTALBE Model Report/xsl/Default/XSL_FO Model Report/xsl/Custom/XSL_FO Use Case Report/xsl/Custom/XSL_FO

Some location examples:


Report Type

Model Report Model Report Model Report Model Report

HTML Browsable HTML Printable XSL Formatting Objects XSL Formatting Objects XSL Formatting Objects

Use Case Report Default 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.
STYLE CREATION EXAMPLE

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 1 Directory "My Style Where "<MagicDraw install dir>/data/report/report_types/ Model Report/xsl Item Description Report Style directory.

2005 No Magic, Inc

7-402

TO O L S Reports

Step Create item 2

Where

Item Description The "Main.xsl" file for HTML browsable report generation will be stored here. The "Main.xsl" file is a XSLT file, which will be used to generate "Model Report" with "My Style" report style and HTML browsable output format.

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

The "Main.xsl" file is placed in the "HTML_BROWSABLE" directory and is intended to generate HTML (browsable) report. But this is not necessary. The real output format depends on the XSL file, which will describe the transformation. In principle the destination output format can be any format the XSL transformation can produce - HTML, XML or plain text. The real meaning of placing the "Main.xsl" file in "HTML_BROWSABLE" directory is that this transformation (without formatting) will be performed when the "HTML Browsable" report output format is selected during report generation.

7-403

2005 No Magic, Inc.

TO O L S Reports

FONTS IN PDF AND PS REPORTS Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP (FO formatter for PDF and PS reports). Currently only Type 1 and TrueType fonts can be added. 1. Font metric file creation FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it. FOP also includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it. To facilitate the metrics file creation the batch file is shipped with MagicDraw installs (data/report/conf/fonts/fontMetricsFile.bat). Usage example: "fontMetricsFile.bat C:\WINNT\Fonts\tahoma.ttf tahoma" The font metrics file "tahoma.xml" will be created.
NOTE

All font metrics files must reside in the "data/report/conf/fonts" directory.

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>

After registering fonts it is possible to use them in PDF and/or PS reports. For more detailed information please follow the link: http://xml.apache.org/fop/fonts.html.

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

GENERATING CONFIGURATION FILE Configuration file contains report generation options. Configuration file can be generated in the Report: open the Report, select all needed options and click Save Configuration button to save the selected options.

2005 No Magic, Inc

7-404

TO O L S Class Diagram Wizard

Configuration file options:


Option Name GENERATE_ALL_DIAGRAMS Description true to generate all project diagrams otherwise generate diagrams listed in DIAGRAM_LIST option. Generate recursively: true or false Report page size for *.rtf, *.pdf, and xsl_fo output formats. Style name Package ID, separated by commas. If no value is specified, the report is generated for root package (Data package) Name of the report, which also shows the directory of the report where the generated report will be save, e.g. C:\Reports\shop\index.html Image format: PNG or JPG Template of the report: e.g. for Model Report: Built-In, Behavioral Model Report, or Static Model Report. Name of the used report type: Model Report, Use Case Report, Software Design Description, or Model Extension Report. List of diagrams to generate, if GENERATE_ALL_DIAGRAMS value is false. Values are diagram ID separated by comma. Output format: HTML_BROWSABLE, HTML_PRINTABLE, RTF, PDF, XSL_FO, or PS

GENERATE_RECURSIVELY PAGE_SIZE REPORT_STYLE 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.

CLASS DIAGRAM WIZARD


The Class Diagram Wizard helps you create a new class diagram when all classes and their relationships are already created and specified. You may choose which classes, packages, and relationships will be included in a new class diagram, and the details of class representation (attributes, operations, accessibility) to be configured. The Class Diagram Wizard frees you from creating the class diagram manually. The Class Diagram Wizard, along with its dialog boxes, guide you through several steps and collect information along the way. It will automatically create a new class diagram and all the necessary elements.

7-405

2005 No Magic, Inc.

TO O L S Class Diagram Wizard

To start the Class Diagram Wizard


From the Tools menu, choose New Class Diagram Wizard. The main Class Diagram Wizard appears.

Figure 139 -- Class Diagram Wizard. Diagram name

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:

Next> proceeds to the next step - Select Elements. Cancel cancels the wizard.

2005 No Magic, Inc

7-406

TO O L S Class Diagram Wizard

Help displays MagicDraw Help

Figure 140 -- Class Diagram Wizard. Select Elements


All list contains all model elements. Selected list contains all the elements that are added to the class diagram. 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. Remove removes the selected element from the Selected list. Remove All removes all selected elements. <Back returns to the previous dialog box. Correct data entered in the previous step. Next> proceeds to the next step - Select Relationships. 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.

Buttons available in the Class Diagram Wizard, select elements window:


7-407

2005 No Magic, Inc.

TO O L S Class Diagram Wizard

Cancel cancels the wizard. Help displays MagicDraw Help.

Figure 141 -- Class Diagram Wizard. Select Relationships

Select relationships you wish to include in the class diagram:

Generalization relationship between a more general and a more specific element (inheritance, extension). Realization relationship between model elements where one of the elements implements the interface defined by the other model element. Association semantic relationship between classes. Dependency usage relationship between UML model elements. <Back returns to the previous dialog box. Correct data, entered in the previous step. Next> proceeds to the next step - Specify Symbols Properties. 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. Cancel cancels the wizard.

Buttons available in the Class Diagram Wizard, select relationships window:

2005 No Magic, Inc

7-408

TO O L S Class Diagram Wizard

Help displays MagicDraw Help

Figure 142 -- Class Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the class diagram.


NOTE

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.

Buttons available in the Class Diagram Wizard, symbols properties window: 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. Cancel cancels the wizard. Help displays MagicDraw Help.

7-409

2005 No Magic, Inc.

TO O L S Package Dependency Wizard

PACKAGE DEPENDENCY WIZARD


The Package Dependency Diagram Wizard generates diagrams containing packages (created within a project) and shows the relationships between them. The diagram may reflect all packages in the project, or just those chosen. The Package Dependency Diagram Wizard collects all the information needed to both analyze dependencies and to generate a new diagram.

To start the Package Dependency Diagram Wizard


Choose the Package Dependency Wizard from the Diagrams menu, Diagram Wizards submenu.

Figure 143 -- Package Dependency Diagram Wizard. Diagram name

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:

Next> proceeds to the next step - Select Packages.

2005 No Magic, Inc

7-410

TO O L S Package Dependency Wizard

Cancel cancels the wizard. Help displays MagicDraw Help

Figure 144 -- Package Dependency Diagram Wizard. Select Package.


All list contains all packages. Selected list contains all packages that are added to the diagram. 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. Remove removes the selected element from the Selected list. Remove All removes all selected elements. <Back returns to the previous dialog box. Correct data, entered in the previous step. Next> proceeds to the next step - Specify Symbols Properties. 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. Cancel cancels the wizard.

Buttons available in the Package Dependency Diagram Wizard, selected packages window:

7-411

2005 No Magic, Inc.

TO O L S Package Overview Diagram Wizard

Help displays MagicDraw Help

Figure 145 -- Package Dependency Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the class diagram. Buttons available in the Package Dependency Diagram Wizard, symbols properties window:

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. Cancel cancels the wizard. Help displays MagicDraw Help.

PACKAGE OVERVIEW DIAGRAM WIZARD


The Package Overview Diagram Wizard allows to create diagram for every package from selected scope (reversed packages). Created diagram displays content of packages inner packages with inner elements connected with available relations.

To start the Package Overview Diagram Wizard

Choose the Package Overview Diagram Wizard from the Diagrams menu, Diagram Wizards submenu.

2005 No Magic, Inc

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.

Figure 146 -- Package Dependency Diagram Wizard. Diagram name

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:

Next> proceeds to the next step - Select Packages. Cancel cancels the wizard.

7-413

2005 No Magic, Inc.

TO O L S Package Overview Diagram Wizard

Help displays MagicDraw Help

Figure 147 -- Package Overview Diagram Wizard. Select Package.

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. Next> proceeds to the next step - Define Advanced Options. Cancel cancels the wizard.

2005 No Magic, Inc

7-414

TO O L S Package Overview Diagram Wizard

Help displays MagicDraw Help

Figure 148 -- Package Overview Diagram Wizard. Define Advanced Options

Set the advanced properties for elements to be represented in the diagrams. If you want to see created class diagram all elements structure in the created diagram, select the Show all elements option button (default option). If Show only packages option will be selected, only package content class diagram will be created. The Analyze and show package dependencies check box - creates dependencies among, on level packages. Analyzes are performed of all inner elements, recursively by all criteria. The Show inner packages in the package shape check box - displays one level inner packages in every package shape, connected with dependencies. The Assign hyperlinks to created diagrams check box - adds active hyperlink to every package, referenced to inner diagram of this package. Buttons available in the Package Overview Diagram Wizard, define advanced options window:

<Back returns to the previous dialog box. Correct data is entered in the previous step. Next> - proceeds to the next step - Select Relationships. 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. Cancel cancels the wizard.

7-415

2005 No Magic, Inc.

TO O L S Package Overview Diagram Wizard

Help displays MagicDraw Help.

Figure 149 -- Package Overview Diagram Wizard. Select Relationships

Select relationships you wish to include in the class diagram:

Generalization relationship between a more general and a more specific element (inheritance, extension). Realization relationship between model elements where one of the elements implements the interface defined by the other model element. Association semantic relationship between classes. Dependency usage relationship between UML model elements. <Back returns to the previous dialog box. Correct data is entered in the previous step. Next> - proceeds to the next step - Specify Symbols Properties. 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. Cancel cancels the wizard.

Buttons available in the Package Overview Diagram Wizard, select relationships window:

2005 No Magic, Inc

7-416

TO O L S Tools for Analysis

Help displays MagicDraw Help.

Figure 150 -- Package Overview Diagram Wizard. Select Relationships

Select options for elements to be represented in the diagram. Buttons available in the Package Overview Diagram Wizard, symbols properties window:

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 diagram. All other options will be set by default. The Package Overview Diagram Wizard exits and the created diagram is displayed. Cancel cancels the wizard. Help displays MagicDraw Help.

TOOLS FOR ANALYSIS


MagicDraw contains tools that help you analyze the relationships between elements created in the UML model. It is also possible to analyze the inheritance and dependency relationships between classes. Select a class in the Browser tree or on the Diagram pane. Choose Tools from the class shortcut menu, and then choose analysis tool.

7-417

2005 No Magic, Inc.

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.

To start the Hierarchy Diagram Wizard

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.

Figure 151 -- Hierarchy Diagram Wizard. Specify Name and Package

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:

2005 No Magic, Inc

7-418

TO O L S Tools for Analysis

Next> proceeds to the next step - Select Scope. Cancel cancels the wizard. Help displays MagicDraw Help

Figure 152 -- Hierarchy Diagram Wizard. Select Scope

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:

<Back returns to the previous dialog box. Correct the data entered in the previous step. Next> proceeds to the next step - Select Hierarchies. Cancel cancels the wizard.

7-419

2005 No Magic, Inc.

TO O L S Tools for Analysis

Help Displays MagicDraw Help

Figure 153 -- Hierarchy Diagram Wizard. Select Hierarchies.

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. Next> proceeds to the next step - Specify Symbols Properties 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. Cancel cancels the wizard.

2005 No Magic, Inc

7-420

TO O L S Tools for Analysis

Help displays MagicDraw Help

Figure 154 -- Hierarchy Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the diagram. Buttons available in the Hierarchy Diagram Wizard, symbols properties window:

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. Cancel cancels the wizard. Help displays MagicDraw Help.

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.

To start the Hierarchy Diagram Wizard

From the Diagrams main menu, choose the Diagram Wizards command and then Realization Diagram Wizard .

7-421

2005 No Magic, Inc.

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.

Figure 155 -- Realization Diagram Wizard. Specify Name and Package

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:

Next> proceeds to the next step - Select Scope. Cancel cancels the wizard.

2005 No Magic, Inc

7-422

TO O L S Tools for Analysis

Help displays MagicDraw Help

Figure 156 -- Realization Diagram Wizard. Select Scope

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:

<Back returns to the previous dialog box. Correct the data entered in the previous step. Next> proceeds to the next step - Select Implementations. Cancel cancels the wizard.

7-423

2005 No Magic, Inc.

TO O L S Tools for Analysis

Help Displays MagicDraw Help

Figure 157 -- Realziation Diagram Wizard. Select Implementations

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. Next> proceeds to the next step - Spedify Symbols Properties. 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. Cancel cancels the wizard.

2005 No Magic, Inc

7-424

TO O L S Tools for Analysis

Help displays MagicDraw Help

Figure 158 -- Realization Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the diagram. Buttons available in the Realization Diagram Wizard, symbols properties window:

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. Cancel cancels the wizard. Help displays MagicDraw Help.

7-425

2005 No Magic, Inc.

TO O L S Content Diagram Wizard

CONTENT DIAGRAM WIZARD


The Content Diagram Wizard generates content of all diagrams, usable in the project.

To start the Content Diagram Wizard


1 From the Diagrams main menu, choose Diagram Wizards and then Content

Diagram Wizard.

Figure 159 -- Content Diagram Wizard. Specify Name and Package

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:

Next> proceeds to the next step - Parent package. Cancel cancels the wizard.

2005 No Magic, Inc

7-426

TO O L S Content Diagram Wizard

Help displays MagicDraw Help

Figure 160 -- Content Diagram Wizard. Select Diagrams Types.

Select what types of the diagrams will be included to the content diagram. Buttons available in the Content Diagram Wizard, types of diagrams window:

<Back returns to the previous dialog box. Correct data, entered in the previous step. Next> proceeds to the next step - Select objects. Cancel cancels the wizard. Help - displays MagicDraw Help.

7-427

2005 No Magic, Inc.

TO O L S Sequence Diagram from Java Source Wizard

Figure 161 -- Content Diagram Wizard. Select diagrams.

Buttons available in the Content Diagram Wizard, select objects window:


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. Remove removes the selected element from the Selected list. Remove All removes all selected elements. <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. Cancel cancels the wizard. Help displays MagicDraw Help.

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.

To start the Sequence Diagram from Java Source Wizard


1 From the Tools menu, choose the Model Visualizer command. The Model

Visualizer dialog box appears. 2 In the Model Visualizer dialog box, in the wizards list, select the Sequence Diagram from Java Source Wizard. 3 Double click or click the Start button. The Sequence Diagram from Java Source Wizard is opened. From the Diagrams menu, choose the Diagram Wizards command and then Sequence Diagram from Java Source Wizard.

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).

2005 No Magic, Inc

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). In the Sequence diagram create call message. Select it on diagram pane. Invoke message 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:

Next> proceeds to the next step - Select Operation. Cancel cancels the wizard.

7-429

2005 No Magic, Inc.

TO O L S Sequence Diagram from Java Source Wizard

Help displays MagicDraw Help

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. Next> proceeds to the next step - Select Classes for Diagram. Cancel cancels the wizard.

2005 No Magic, Inc

7-430

TO O L S Sequence Diagram from Java Source Wizard

Help - displays MagicDraw Help.

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:

<Back returns to the previous dialog box. Correct data, entered in the previous step. Next> - proceeds to the next step - Specify Symbols Properties. 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. Cancel cancels the wizard.

7-431

2005 No Magic, Inc.

TO O L S Pattern Wizard

Help displays MagicDraw Help.

Select options for elements to be represented in the sequence diagram. Buttons available in the Sequence Diagram from Java Source Wizard, specify symbols properties window:

<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. Cancel cancels the wizard. Help displays MagicDraw Help.

NOTE:

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.

2005 No Magic, Inc

7-432

TO O L S Pattern Wizard

To open the Pattern Wizard


In the class diagram, click the Class by Pattern button. 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.

Figure 165 -- Pattern Wizard

The Pattern Wizard has three main collections of customizable options, which are represented by hierarchy tree on the left side of the dialog box:
Category Gof Templates described in the Design Patterns of Reusable ObjectOriented Software Design Pattern Adapter Properties 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.

7-433

2005 No Magic, Inc.

TO O L S Pattern Wizard

Category

Design Pattern Bridge

Properties 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. Component Class Composite Class NOTE The Next > button is activated. In the Composite Operations screen, add or remove operations you want to use. 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. Subject Class Observer Class Concrete Subject Class Concrete Observer Class 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 class 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 class

Composite

Decorator

Observer

Proxy

Singleton Visitor

Java Specific Java design patterns

Main

2005 No Magic, Inc

7-434

TO O L S Pattern Wizard

Category

Design Pattern EJB Entity

Properties

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 EJB Name EJB Class Display Name Large Icon Small Icon Acknowledge Mode Destination Type Subscripting Durability Message Selector Transaction Type 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.

Message Driven

Session

7-435

2005 No Magic, Inc.

TO O L S Pattern Wizard

Category

Design Pattern Java RMI

Properties Java RMI Class Remote Interface NOTE The Next > button is activated. In the Remote Methods screen, add or remove operations you want to use. TestCase Class Create suite() Create Constructor TestCase(String) Create runTest() Create setUp() Create tearDown() 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. Target Class Content: XSDcomplex content, XSDsimple content.

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.

XML Schema Specific XML design patterns

XSD complex Type

XSD Target Class compositor Compositor: XSDall, XSDchoice, XSDsequence Particle XSD simpleType XSD simpleType (XSDlist) XSD simpleType (XSDunion) Target Class Content: XSDrestriction, XSDlist, XSDunion Target Class Item Type Target Class

2005 No Magic, Inc

7-436

TO O L S Pattern Wizard

Category

Design Pattern Simple XSD restricton

Properties 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 Use the Binding pattern when you want to create binding of some PortType. Name Abstract Local Interface Name Abstract Custom Value Type Name Type Definition Specifier: typedef, boxed value Base Type Name Base Type Sequence Size Anonymous Name Base Type Array Size Anonymous Name Digits Scale Anonymous Name Discriminator Type Name Name Name Go back to the Pattern screen.

WSDL Specific WSDL design pattern CORBA IDL Specific CORBA IDL design patterns

Binding

Interface

Value Type

Type Definition Sequence

Array

Fixed

Union Enume ration Struct Exception < Back

7-437

2005 No Magic, Inc.

TO O L S Creating Setters / Getters

Category Next > Finish

Design Pattern

Properties Go to the other appropriated screen. Finishes and implements the wizard. The appropriated classes and interfaces are created. Cancels the wizard without implementing your actions. The MagicDraw Help is displayed.

Cancel Help

CREATING SETTERS / GETTERS


Setters and getters are common operations that contain almost every class. With the help of MagicDraw UML, set and get operations for class attributes can be generated automatically.

To create a setter or getter

From the shortcut menu of the selected class, choose Tools, and then choose Create Setters/Getters. The Select Attributes/Association Ends dialog box appears. Add a tagged value "getter/setter for attribute=attribute_name" to the selected class.

Figure 166 -- Select Attributes dialog box

Box All

Function Contains names of all attributes defined within the selected class.

2005 No Magic, Inc

7-438

TO O L S Implementing or Overriding Operations

Box Selected > < >> <<

Function Contains the selected attributes. 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. Moves all attributes from the Selected to the All list.

Prefix to Remove Type a prefix of an attribute (-, .) you want remove while generating setters or getters. Create Setters Create Getters Prefix for Setter Prefix for Getter Generates setters for the selected attributes. Generates getters for the selected attributes. Choose a prefix for the generated setter (operation). Possible choices: set or Set Choose a prefix for the generated getter (operation). Possible choices: get;is, Get;Is; get, or Get. NOTE Get is used for every getter, is is used if the type of an attribute is set as Boolean. Generates setters or/and getters for attributes that are in the Selected Items list. Exits the dialog box without any changes. Displays MagicDraw Help

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:

public void setx (int x)

public <attribute type> get + <attribute name> ( )

public int getx ();

IMPLEMENTING OR OVERRIDING OPERATIONS


When you inherit classes from the base class, which has abstract functions, you have to redefine them in the inherited classes. The implement/override operations tool will help you generate operations that are defined as abstract in the base class. The command Implement/Override Operations command can be invoked in 2 cases:

When one classifier inherits operations from the base classifier (Generalization relationship). When some classifier implements Interface (Realization relationship).

7-439

2005 No Magic, Inc.

TO O L S Model Transformation Wizard

To start the Implement/Override Operations tool


From the shortcut menu of the selected class, choose Tools. Then, choose Implement/Override Operations. The Select Operations to Implement/Override dialog box appears.

Figure 167 -- Select Operations to Implement/Override dialog box


Box Function

All Selected > < >> << OK Cancel Help TIP!:

Contains names of all operations defined within the selected class. Contains the selected operations. 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. Moves all operations from the Selected to the All list. Generates operations that are in the Selected list. Exits the dialog box without any changes. Displays MagicDraw Help

Double-click the item name, and it will be moved to the opposite list.

MODEL TRANSFORMATION WIZARD


Model transformation 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. TYPES OF THE TRANSFORMATIONS The available from/to types of transformations are:

2005 No Magic, Inc

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. DDL to UML - derives UML model from DDL model.

MODEL TRANSFORMATION WIZARD

To start the Model Transformation Wizard


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.

7-441

2005 No Magic, Inc.

TO O L S Model Transformation Wizard

Figure 168 -- Model Transformation Wizard. Select transformation type

Types of the transformations are displayed in the list window. Buttons available in the Model Transformations Wizard, Select transformation type window:

Next> proceeds to the next step - Select source/destination. Cancel cancels the wizard. Help displays MagicDraw Help.

Figure 169 -- Model Transformation Wizard. Select source/destination

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:

<Back returns to the previous dialog box. Next> proceeds to the next step - Select type mappings. 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. Cancel cancels the wizard. Help displays MagicDraw Help.

Figure 170 -- Model Transformation Wizard. Select type mappings

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:

<Back returns to the previous dialog box. Next> proceeds to the next step - Specify transformation details. (This button is disabled in Any to Any transformation).

7-443

2005 No Magic, Inc.

TO O L S Model Transformation Wizard

Finish finishes the configuration of transformation. The Model Transformations Wizard exits and results of transformation appear in the project. Cancel cancels the wizard. Help displays MagicDraw Help.

Figure 171 -- Model Transformation Wizard. Specify transformation details

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:

<Back returns to the previous dialog box. Finish finishes the configuration of transformation. The Model Transformations Wizard exits and results of transformation appear in the project. Cancel cancels the wizard. Help displays MagicDraw Help.

MODEL TRANSFORMATION MAPPING When transforming the model, it is possible to map types, used in the classes of the transformation. This mapping is usually used to map primitive types from one domain into appropriate primitive types in another domain. The map is a collection of rules from type - to type. The following elements can be used in creating mapping rules. They are stored in the Model Transformation Profile.

2005 No Magic, Inc

7-444

TO O L S Model Transformation Wizar d

To create transformation mapping rules


1 Import or use Model_Transformation_Profile.xml.zip. 2 To the newly created rules package, apply stereotype with name <<

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:

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.

7-445

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:

2005 No Magic, Inc

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.

Control of mapping behavior of the type inheritance in destination model also is possible. This is only effective on second (and successive) application of the transformation. By default derived subtypes in the destination model are not overwritten - they are considered suitable substitutes of their parent.

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.

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). A special type EmptySourceType is used to indicate that the attributes with no type should be mapped with this dependency.

7-447

2005 No Magic, Inc.

TO O L S Model Transformation Wizard

A special type EmptyDestinationType is used to indicate that the attributes in the destination classes should have no type after remapping (type removal). 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.

A special type AnyDestinationType. This type is a template, it matches any type in the destination model (see mapping rules for type inheritance).

MODEL TRANSFORMATION UPDATE When reapplying transformation, relationships are retrieved from their storage, and used to find the model elements in destination model, corresponding to the given model element in the source model. If there are model elements in the source model, that have no mapping - this means, that the elements are newly added. The usual rules for the transformation are used (the same behavior, as if the transformation was applied the first time) for these model elements. If the model elements already have mapping, then there are 2 options: to update the properties of the mapped element, or to leave transformation model intact.

To update transformed model

From the destination package shortcut menu, choose Tools and then Update Transformed Model. The Model refresh options dialog box appears:

Figure 172 -- Model refresh options dialog box

The Change destination properties according to source option overwrites elements properties in destination model with the properties from the source model (but only elements, which are connected with mapping dependencies ). The Leave destination properties intact option does not overwrite properties in destination model with the properties from the source model (retaining the changes, which user has made to the destination model, but ignoring changes, which user has made to the source model).
NOTE:
2005 No Magic, Inc
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:

UML model metrics 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 low value font color is blue. 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:

List of metrics that shall be counted. Specified properties for each selected metric.
2005 No Magic, Inc.

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. Graphics tab. Selected metric is displayed as a graphic.

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 PackageA Inner class1 Inner class2 Metric1 value value value Metric2 value value value Metric3 value value value value value value . value value value MetricN value value value

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 Classes classes and interfaces shall be displayed Diagrams Package Violations only rows that contain packages violations shall be displayed. Class Violations only rows that contain classes and interfaces violations shall be displayed.
7-450

2005 No Magic, Inc

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.

Figure 173 -- Metrics dialog box

Element Metrics Suite Calculate For

Desription All suits that are created in Metrics Suites dialog are available in this combo box. Combo box contains two values: Whole Project metrics will be calculated for a whole project. Selection metrics will be calculated only for the selected items. After clicking the button, the Select Elements dialog appears. Button invokes Metrics Options dialog. Metrics window appears.

Metrics Options Calculate

7-451

2005 No Magic, Inc.

TO O L S Metrics

Select Elements dialog box:

Figure 174 -- Select Elements dialog box

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.

2005 No Magic, Inc

7-452

TO O L S Metrics

Data tab contains metrics table:

Figure 175 -- Metrics window

GUI element Expand Current Branch Collapse Current Branch Refresh Metrics Options Export Compare Metrics With Print Filter

Desription Expands all elements in selected branch in results table. Collapses all elements in selected branch in results table. Recalculates metrics results according current model. Metrics Options dialog box appears. Export Metrics dialog box appears. Open dialog box appears. Select text file to compare with currently opened metric set. Prints metrics table. Print dialog appears. Combo box contains values: All Packages Classes Diagrams Package Violations Class Violations

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

2005 No Magic, Inc.

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.

In *.txt format metrics are separated by tabs in below listed form:


Element Package Package1 Class class1 (Package1::class1) Class class2 (Package2::class2) Metric1 Metric2 Metric3 . value value value value value value value value value . . . MetricN Value Value Value

Here Metric1 .. MetricN the metric name abbreviation. At the bottom of file technical information is displayed. Text Elements ID are added after elements metrics, and elements IDs will be printed. This information is needed for metrics comparance.

In *.html format information is given in the below shown form:


Metrics Report Element Package Package1 (Package1) Class class1 (Package1::class1) Metric1 value value Metric2 value value Metric3 value value . . . Metric N 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.

2005 No Magic, Inc

7-454

TO O L S Metrics

Metrics export is done through Export Metrics dialog box:

Figure 176 -- Export Metrics dialog box

Element Metrics Output File: Output Type:

Description Path and file name of metrics results output file. The button allows to select location and file. Combo box contains values: Text (*.txt) HTML (*.html) The whole metrics table is exported to a file when this checkbox is cleared. Only selected table rows and header row are exported to the file, when the checkbox is selected.

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.

To open the Metrics Options dialog box:

From the Tools menu, choose Metrics and then Metrics Options

7-455

2005 No Magic, Inc.

TO O L S Metrics

In the Metrics dialog box, click the Metrics Options button.

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:

Figure 177 -- Metrics Options dialog box

Element Metrics suites list Metrics suites list buttons: Clone Rename Remove Import Export Metrics tree Properties list

Description All created metrics suites are displayed in a list. Clone clone the selected suite. Rename rename the selected suite. Remove remove the selected suite. Import import new suite. The Open dialog box appears. Export export the selected suite. The Save dialog box appears. All these commands are available from each metric suite shortcut menu.

Tree is intended to select metrics that will be counted for a metrics suite. All metrics are displayed in metrics tree. Metric properties are displayed individual for each property.

2005 No Magic, Inc

7-456

TO O L S Metrics

Select All Clear All Reset to Default

Select all metrics. Clear all metrics. Predefined MagicDraw metrics are reset to the default metrics suite. User created metrics suites are reset to the selected predefined metrics suite. Dialog box Reset Metrics Suite appears:

Description OK

Selected metric description is displayed in this area. Save all changes and close dialog box.

7-457

2005 No Magic, Inc.

TO O L S Metrics

Metrics properties

Properties Group General

Property

Description Defines what shall be counted: Local inside package (class). Global - inside package (class) recursively Average metrics shall be counted from the lowest level of the elements tree. Each upper level metric shall be counted as average of current object metric and all lower level metrics: Average_element_metric = (Element_metric_value (if may be counted separately) + sum (inner_elements_metrics_values)) / (1 (if element_metric_value was counted) + count_of_inner_elements_that_have_metrics_counted) Average metric value should be rounded into the lower value (e.g 1.5 = 1, 1.6 =2) Min lowest level metrics shall be counted. Each upper level metric shall be set to minimum of current object metric and all lower level metrics (except the metrics that are equal 0). Min_element_metric = min (Element_metric_value, min (inner_elements_metrics_values)) Here metric_value > 0 Max lowest level metrics shall be counted. Each upper level metric shall be set to maximum of current object metric and all lower level metrics. Max_element_metric = max (Element_metric_value, max (inner_elements_metrics_values)) Here metric_value > 0 Recommended lowest metric value for package. Editable. Recommended lowest metric value for class and interface. Editable. Recommended lowest metric value for diagram. Editable. Recommended highest metric value for package. Editable. Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color). Recommended highest metric value for class and interface. Editable. Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color). Recommended highest metric value for diagram. Editable. Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color).

Calculate

Lowest limit

Package Class Diagram

Highest limit Package

Class

Diagram

2005 No Magic, Inc

7-458

TO O L S Metrics

Properties Group Include Weight

Property

Description This properties group defines if specified information shall be included when counting metric. This properties group defines if specified information shall be included when counting metric.

Example of metrics calculation for calculating number of classes (NC) for this tree:

Calculated metric values with different aggregation:


Element Top Inner1 C1 C2 c_in1 c_in2 Inner2 C3 c_in3 c_in4 C4 Local 1 2 0 2 0 0 1 2 0 0 0 Global 8 4 0 2 0 0 3 2 0 0 0 Average 1 1 0 1 0 0 1 1 0 0 0 Min 1 2 0 2 0 0 1 2 0 0 0 Max 2 2 0 2 0 0 2 2 0 0 0

7-459

2005 No Magic, Inc.

TO O L S Metrics

2005 No Magic, Inc

7-460

TO O L S Metrics

7-461

2005 No Magic, Inc.

TO O L S Metrics

2005 No Magic, Inc

7-462

MAGICDRAW USER S MANUAL Index

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

in use case diagram 218 instance of 248 n-ary 220 navigability of 224 with a role 191 association class 220 association end 220 changeability of 225 instance of 248 multiplicity of 224 qualifier of 225 visibility of 224 association role 244, 252 asynchronous message/stimulus 255 attribute 188 creating new 188 defining initial value of 247 multiplicity 192 scope of 192 show only public 207 type modifier of 191 type of 191 attributes controlling the list of 185, 235 representing as association 191 sorting of 208 suppressing compartment 207

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

2003 No Magic, Inc.

464

MAGICDRAW USER S MANUAL Index

operation for 263 Call (event type) 290 Change (event type) 290 changeability of association end 225 changeable 192 child element 216 class 183 active 185 analyzing 185 composite object 248 creating setters and getters 438 defining as abstract, leaf, root and/or active 185, 235 description of 183 design patterns 205 inner elements of 185 owner of 145 parameterized 199 show/hide package name 145 suppressing attributes 207 suppressing operations 207 class diagram 176 elements in 178 incompatibilities between Rose and MagicDraw 107 incompatibilities between Together and MagicDraw 112 wizard 405 classifier as scope 192 assign to an instance 247 assigning to a collaboration 215 assigning to classifier role 252 classifier role assigning classifier to 252 defining multiplicity of 252 in collaboration diagram 244, 251 in sequence diagram 266 relationships between 252 closing all opened projects 84 diagram 122 code engineering checking syntax 90 creating new set 89 editing set 89 code generation 90 changing properties of 90 collaboration 214 assigning an instance 215 assigning classifier to 215

collaboration diagram 242 changing numbering in 258 incompatibilities between Rose and MagicDraw 107 incompatibilities between Together and MagicDraw 113 instance level 242 specification level 242 compartments of class 183 component 314, 318 assigning model elements 321 diagram 312 instance 314 view 176 Component View package 44 composite object 248 state 280 composition 223 concurrency of operation 198 concurrent composite state 282 operation 198 regions 285 state 282 substates 280 condition 264 conditional branch 271 constraints 339 show-hide on symbol 144 showing on class 208 content diagram 359 copying/cutting among different projects 95 in the Browser 95 of text 133 symbol on a diagram 132 using drag and drop 132 CORBA IDL diagram 371 create (action type) 263 instantiation of 263 creating backup file 47 displaying already created relationships 129 elements and diagrams in Browser 95 new attribute 188 new code engineering set 89 new diagram 120 new operation 193 new project style 53 paths between shapes 129 stereotypes 325

2003 No Magic, Inc.

465

MAGICDRAW USER S MANUAL Index

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

do activity action 288 documentation of MagicDraw 14 drag and drop copying 132 from browser to diagram 132 multiple symbols 132 source code files 133 drawing more than one shape 126 shape 126 symbol from the Browser 95 dynamic action state 301 choice point 287

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

2003 No Magic, Inc.

466

MAGICDRAW USER S MANUAL Index

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

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

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

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

2003 No Magic, Inc.

467

MAGICDRAW USER S MANUAL Index

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

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

N
name specifying for a shape 126 n-ary association 220 navigability of association 224 node 314, 321 assigning components to 322

P
package 178, 208, 315 adding inner elements 209 changing header position 210 Component View 44

2003 No Magic, Inc.

468

MAGICDRAW USER S MANUAL Index

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

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

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

2003 No Magic, Inc.

469

MAGICDRAW USER S MANUAL Index

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

2003 No Magic, Inc.

470

MAGICDRAW USER S MANUAL Index

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

WSDL diagram 376

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

2003 No Magic, Inc.

471

Anda mungkin juga menyukai