version 9.5
CONTENTS
0
1-12
CONTENTS 2
1 INTRODUCING MAGICDRAW
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
2 GETTING STARTED
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
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-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
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
Profiles
Creating profiles 3-74 Using and importing profiles Exporting profiles 3-76
3-74
3-75
Models comparison 3-77 Understanding model differences 3-78 Diagrams Comparison 3-81
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
3-104
3-109
3-112
Resources Manager
3-114
4 DIAGRAMS BASICS
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
Laying out
4-153
Zooming 4-162 Using Grid 4-163 Assigning Shortcut Keys 4-164 Printing 4-165
Print Range tab
4-165
5 UML DIAGRAMS
System Views
5-174
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
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
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 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
5-323
6 EXTENSION DIAGRAMS
Content Diagram 6-359 Robustness Diagram
6-358
6-360 6-364
6-363
6-367 6-372
CORBA IDL Diagram Elements DDL Diagram Elements WSDL Diagram Elements 6-375
6-371
6-377 6-380
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
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
10
INTRODUCING MAGICDRAW
Todays graphical software can be extremely complex in its structure and architecture, but that does not mean it must be difficult to use. We have learned much from the hardware industry, where everything you see is scattered pieces. This approach also works well in the software world objects at a higher abstraction level are treated like software pieces. To simplify the process further, we may use pictures instead of textual descriptions to show the relationships between objects in a complex system. Though pictures work better than textual descriptions alone, experience has proven that communicating complex ideas effectively requires more than simple flowcharts. Early methodologies, such as Booch notation, OMT, and others, served the same purpose: to graphically express the softwares architecture information. However, these methodologies accomplished this in slightly different ways and with different levels of thoroughness. In 1994, Grady Booch, Jim Raumbaugh, and Ivar Jacobson came together to unify their varied methods and experience. The UML (Unified Modeling Language) was the fruit of their joint effort. UML was crafted with two objectives: To reflect the best practices of the industry, and to demystify the process of software system modeling. In short, UML provides standardized pictures of your software applications and allows your development team to quickly grasp the functionality contained within the application. UML is a language and a process with neutral notation, which means that you may use it to design your entire OO system in any programming language and any software development process. The development of a model for an industrial-strength software system, prior to its construction or renovation, is as essential as having a blueprint for a large building. Good models are vital for effective communication among project teams. In the early 1990s, the tools for OO software modeling emerged, followed by the development of the visual modeling approach. Visual modeling means that you first design your system by drawing diagrams (blueprints) and then employ tools to convert those diagrams into code. The value of such an approach is that the often tedious framework coding is done automatically, freeing the programmer to focus on design issues, plus, the transition from the design to the implementation phase is smoother more and straightforward. Moreover, using the features of reverse engineering and code generation, the developer may move back and forth between the code and the design that is expressed in the diagrams. Today, visual modeling tools provide many features that replace some of the more tedious tasks for the designer, programmer, and documentation writer. Some of the leading tools provide so-called code round-trip engineering capabilities the structure of reverse engineered code is changed in the modeling tool and is generated back without the implementation of specific information (e.g. method bodies, comments) loss.
1-12
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.
Java version - Code engineering for Java, Java bytecode. Integration with Java IDEs.
1-13
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.
1-14
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
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
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
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-
OTHER DOCUMENTATION Readme files. In the main MagicDraw installation directory, the main readme.html file is located. Also readme documents are available for MagicDraw integrations.
1-16
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
GETTING STARTED
S y s t e m r e q u i r e m e nt s
To run MagicDraw UML, your system must meet the following requirements:
Resource type 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
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
2-20
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
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
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.
UPDATING
Automatic updates feature is implemented in MagicDraw. Notification and update of all the patches can be done automatically.
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.
2-22
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.
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
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
Environment Options
You may customize MagicDraw according to your preferences: Change the application settings of your project in the Environment Options dialog box.
2-24
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
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
Save diagram background in image Save project recovery data on idle Save rich XMI
Show font face in font list Font names that are listed in the Font drop-down list box on the main toolbar will be displayed in the original font.
2-26
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.
2-27
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.
2-28
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
Property name
Function
2-29
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.
2-30
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
FLOATING PANE This pane is available only if you use MagicDraw Floating License.
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.
2-32
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
UPDATE
PANE
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.
2-34
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
KEYBOARD
PANE
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
2-36
Function Removes the selected keys from the selected command. Removes all keys from the selected command.
PLUGINS
PANE
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
RESOURCES PANE Displays the external resources such as dtd, xsd, etc. that are used in MagicDraw.
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.
2-38
Function Add a new external resource that will be ignored. Remove the selected ignored resource from the list.
2-39
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.
2-40
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:
2-41
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.
2-42
The term project is used to describe the problem that must be solved, including all the possible solutions for how the problem can be resolved and finally developed. All works in MagicDrawTM UML are organized into projects. Project is a top one entity where all modelrelated data (the set of diagrams) is held. Project data is organized by object orientation, which makes its management intuitive and in accordance with the problem that is being solved. In this Section, you will find the following chapters:
1 "Creating New Project ", on page 44 2 "Saving and Exporting", on page 46 3 "Loading", on page 50 4 "Project Options. Style Engine", on page 51 5 "Modules Functionality. Reusing project part - Partitioning", on page 63 6 "Profiles", on page 74 7 "Model Differencing", on page 76 8 "Working with multiple projects", on page 83 9 "Using Browser", on page 84 10"Searching", on page 99 11"MagicDraw and Rational Rose", on page 104 12"MagicDraw and Together ControlCenter", on page 109 13"Resources Manager", on page 114
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
3-44
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.
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.
3-45
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.
3-46
To save changes for the later sessions, revised projects must be saved. While saving, you may edit the changeable name of the project and the file format.
click the Save button on the main toolbar, or press shortcut keys CTRL+S. The Save dialog box appears. 2 Select the destination directory (where you wish to save the project) and type the file name for it. 3 Choose the format for saving a project: Packed XML (*xml.zip) (default) or Extensible Markup Language (*.xml) 4 Choose the version of XMI - 1.0, 1.1, or 1.2. Also if you want to save maximum additional information to xmi file, which is not required on Magic Draw load but may be useful using other tools, select Rich XMI button.
NOTE
If the Create Backup File check box is selected in the Environment Options dialog box, MagicDraw always creates a backup file that has the previously saved project. The backup is held in a file with a name identical to that of the project. For a detailed description of the Environment Options dialog box, see Section Setting Personal Preferences on page 2-24.
3-47
Export, and then Template. 2 The Export Template dialog box appears. 3 Type the name and a description of a template. 4 Click OK.
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
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)
3-48
To save the current diagram, or the selected element, within the diagram as an image
1 From the File menu, choose Save As Image. The Save As Image dialog box
appears. 2 Select the Active Diagram or the Selected Symbols option button. 3 Select the file format (*.svg, *.eps, *.dxf, *.wmf, *.png, *.jpg, *.emf), file name, and the location directory.
The 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.
The filename of the saved diagram will be the same as the name of that diagram.
3-49
WO R K I N G W I T H P R O J E C T S Loading
The Not Empty Diagrams list contains all exportable diagrams that contain UML elements. Empty diagrams are not displayed, select the diagrams you wish to export:
To display in the list all diagrams that are available in the project
Click the Load All Diagrams button in the Save As Image dialog box.
Autosave
After you stop working with MD, an idle time passes and the current project is saved to a special file - AutoRecovery file. If application is terminated normally, AutoRecovery file is removed. If application crashes, AutoRecovery file is left. On startup, MagicDraw checks for AutoRecovery file, if it exists, suggests to load a project from this file.
To save AutoRecovery file of the opened project(s) when a system is not in use.
1 Open the Environment Options dialog box. 2 In the General pane, select the Save Project Recovery Data on Idle check box.
Also enter the system idle time (in minutes) when to activate file recovery save in the Idle Time to Activate Recovery Save text box.
LOADING
IMPORTANT! Beginning with MagicDraw Version 3.6, the native MagicDraw format is .xml.
TIP: NOTES:
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.
3-50
If the Open Last Project on Startup check box in the Environment Options dialog box is selected, the last project you worked with will be opened right after MagicDraw starts. XMI v1.0, v 1.1 and v1.2 are native MagicDraw file formats for model storage. But these formats do not specify how to store diagrams. So if you use MagicDraw to open the XMI file, exported with another tool, only the model will be loaded (diagrams, views not). MagicDraw can not "import" such XMI, it can only open it. For model interchange you should use the Unisys XMI 1.0. If your tool does not support Unisys XMI 1.0, you will not be able fully (with diagrams) exchange the model. More about interchange with Rational Rose ant Together ControlCenter, see in Section MagicDraw and Rational Rose on page 3-104 and Section MagicDraw and Together ControlCenter on page 3-109. You may load more than one project within the same MagicDraw session. Separate workspace will be created for each project that is opened.
Pr o j e c t O p t i o n s
The Project Options dialog box is used for defining properties for model elements (shapes and paths) and diagrams, for creating your own project style, importing or exporting the created project style, and defining code engineering options.
3-51
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.
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
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 make a selected style your default style for newly created projects
Click the Make Default button in the Project Options dialog box.
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
To save the created style (export) for a later usage or for other users
Click the Export button. The Save dialog box appears. Select the directory where you wish to export a style. SYMBOLS PROPERTIES STYLES TREE Expands the tree hierarchy of all the styles defined within the project. You may use as many of these styles as you wish. Shape and Paths trees have the inner structure to help you find the model element, the representation of which must be changed. The right side of the dialog box contains possible choices and instruments to manage them.
3-54
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
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
3-56
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 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
3-57
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.
branch, select the specific element (shape, path, diagram, or stereotype) and right click the mouse button. The list of diagrams in which element symbol may be created, appears.
3-58
2 Select the diagram type. Diagram is added as additional branch to the section.
3 Set the style properties for the element in the right pane of the Project Options
dialog box. Properties will be applied only in the specified type of diagram. Element may be extended by diagram in the Project Options dialog box, specific elements pane, clicking the Extend by Diagram button. The Extend by Diagram dialog box appears. Click the Add Diagram button and select a diagram from the list.
Select extended diagram and on the right click mouse button, choose Remove.
In the Project Options dialog box, extended diagram style properties pane, click the Remove button.
PROPERTIES INHERITANCE All element properties have inherited check box. This check box indicates if property is derived from the base element properties, or is it specific.
3-59
The Inherited column check box value in the elements properties pane specifies if current property is synchronized with its parent property. When the Inherited value is true, elements property is changed after changing the parent property. If property has no correspondent property in upper (parent) level, the Inherited column check box is cleared and disabled. If property is modified for the specific element and value differs from the upper level current property value, the Inherited column check box is cleared automatically. GENERAL STYLE PROPERTIES You may define the common properties for the whole style. The style properties are displayed when properties style is selected in the Project Options dialog box styles tree. SHAPES, PATHS AND DIAGRAMS PROPERTIES All shapes, paths and diagrams that may be created in the project, are listed in the Project Options dialog box. If the Shapes, Paths or Diagrams branches are selected in the tree, the general properties may be set in the right pane of this dialog box. When expanding any of these branches, the style for concrete element (diagram) may be created.
Apply button. The Select Diagrams dialog box appears. The list of diagrams, which were created in the project, is displayed.
3-60
2 Select diagrams in which element properties will be applied and click OK. The
3 Choose which properties will be applied to element symbol from the All to NOTE!
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
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.
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 apply stereotype properties for already created symbol with assigned stereotype
1 When stereotype style properties in the right pane of the Project Options dialog
NOTE!
box are changed, click the Apply button. The Select Diagrams dialog box appears. 2 Select diagrams in which stereotype properties will be applied and click OK. 3 In the Select Properties to Apply dialog box, choose which properties will be applied to stereotype. Click OK. You may apply stereotype properties to symbol after changing style properties and in the Project Options dialog box clicking OK. Style will be applied when selecting symbol on the diagram pane and from the main toolbar clicking the Apply Default Symbol Style button.
3-62
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
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.
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
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.
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.
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
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
TIP
dialog box. In the Shared Packages dialog box, the Selected Objects tree, packages you want to share are selected. 2 In the Shared Packages dialog box, you may add packages you want to share. To do this, in the All Data tree, select packages you want share and click the Add button. Click Ok button. Not only package can be shared, but model and subsystem too.
3-66
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.
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
reloading it in the other opened project, where this module is used as a part of the project model.
PACKAGES
3-68
In this situation, MagicDraw can suggest moving relationship into the parent package of this external element, e.g. in this example package1 is a parent of class B, so the relationship can be moved from module into package1:
This movement can be done in the Package Dependencies dialog box, by clicking the Solve button. For a detailed description of this dialog box, see Section Package Dependencies dialog box on page 3-72.
Also you may draganddrop the relationship from one package to another manually in the Browser tree.
3-69
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:
If you want to skip this dependency, click the Export button. After opening the module as a separate project, this relationship will be absent.
3-70
contained in an external model, such package can be exported into independent module without warnings:
Figure 35 -- Example of relationship when module does not depend on external element
DEPENDENCIES BY REFERENCE Module depends on external elements, when model elements from modules packages have references to external elements.
In this case, the module package cannot be exported into independent module. DIAGRAMS DEPENDENCIES Diagram depends on all model elements displayed in this diagram. If diagram is contained in some module package and depends on external elements, this package cannot be exported into module.
About the package dependency on external elements, see Section Module depends on external elements on page 3-68.
3-71
In this case, if diagram is not important for the module, it can be moved from the module package into any external package manually by dragging and dropping in the Browser tree:
Figure 38 -- Diagram is moved from the module package to the package1 package.
Pa c k a g e D e p e n d e n c i e s d i a l o g b o x
The Package Dependencies dialog box appears when the package cannot be exported to the project module, because dependencies with external model elements are found (see more detailed information about the types of package dependencies in the Section Packages dependencies by relationships on page 3-68.
3-72
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.
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
WO R K I N G W I T H P R O J E C T S Profiles
The best solution for group work on the same project is MagicDraw Teamwork Server. For more information about the Teamwork Server, see the MagicDraw Teamwork System Users Guide.
PROFILES
The profile is defined using the extensibility mechanisms of UML, which allow modelers to customize UML for specific domains, such as software development processes. In MagicDraw, profiles mechanism is similar to modules functionality although the profile is a package with stereotype <<profile>> and its content is visible in Profiles dialog box, and UML extensions tabs of Specification dialog boxes. There are several ways of how you may work with profiles. You may:
1 Create your own profile. 2 Use already created profile. 3 Import already created profile 4 You may export your created profile.
Creating profiles
Usually the profile contains specific stereotypes, constraints, tagged values that you may use according your needs. Sometimes profiles also contain other specific model elements and MagicDraw allows to include them into profile. You can use your created profile in other projects parts or other projects. Also other users also may reuse it as a module.
elements you need for extending UML. How to add stereotypes, tagged values, or constraints to the profile (package), see Section UML Extension Mechanisms on page 5-323. The created profile will appear in the Profiles dialog box and in the Tagged Values and Stereotypes tabs of Specification dialog boxes. More about working with UML extensions, see Section UML Extension Mechanisms on page 5-323.
3-74
WO R K I N G W I T H P R O J E C T S Profiles
where the desired profile is located, then choose the desired profile, and click OK. The chosen profile will appear in the Browser tree in a read-only status. You may use it in your project. Also you may import it and edit, if needed.
From the profile, that you have chosen to use, shortcut menu in the Browser, choose Modules and then Import Module. From the File menu, choose Import. The Import dialog box appears. Choose the profile you want to import and click Open.
The imported profile will appear as a editable package in the Browser. You will be able not only to use the contents of package and also to edit it.
3-75
WO R K I N G W I T H P R O J E C T S Model Differencing
Exporting profiles
If you want to use the created profile in the other project or provide the ability for other users to use your profile, you may save the created profile in the selected directory. Exporting profiles is similar to exporting modules functionality.
1 From the File menu, choose Export, and then choose Profile/Module. 2 The Export Profile/Module dialog box appears. Choose the <<profile>>
package you want to export and add to the Selected. Write the description of the profile, click OK and save it to the desired directory.
MODEL DIFFERENCING
Since MagicDraw version 9.0, model differencing functionality is presented. Now you are able to compare two MagicDraw UML local projects or teamwork project versions, as well as diagrams. Model elements are compared by elements ID.
3-76
WO R K I N G W I T H P R O J E C T S Model Differencing
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.
3 From the Active Project combo box, choose a project you want to compare with
another project. The list contains names of all opened projects in MagicDraw. 4 From the Compare With combo box, choose a project with which you want to compare the first project. The following options are available:
3-77
WO R K I N G W I T H P R O J E C T S Model Differencing
opened project names are listed, except the project, which is selected in the Active Project combo box. Local Project. Click the "" button and choose a project version you want to compare the current project with. Teamwork Project. Click the ... button and from the Open Teamwork Project dialog box, select a project ant its version you want to compare with. <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.
3-78
WO R K I N G W I T H P R O J E C T S Model Differencing
In the Difference Viewer dialog box two compared projects are displayed. At the bottom of the dialog box number of differences is displayed. Differences number includes inserted, deleted, and modified elements. Number does not include elements that inner elements are changes. Differences number is displayed in following order: For marking model element changes several colors are used:
Elements that do not exist in the other model (inserted elements). Element is
displayed only in the right-hand tree. New element is highlighted in light green color.
Elements that exist in other model, but do not exist in current model (deleted elements). Elements always are displayed in the left-hand tree. Deleted element
is highlighted in grey color.
3-79
WO R K I N G W I T H P R O J E C T S Model Differencing
Elements that inner elements are changed. Element is marked in both trees.
Such element is highlighted in light grey color dashes. Element with modified element data and changed inner elements is marked as modified and as element with changed inner elements. Element is marked as modified when:
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.
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
3-81
WO R K I N G W I T H P R O J E C T S Model Differencing
2 The Diagrams Difference Viewer dialog box appears, which displays both
Current (or first opened) project diagram is displayed at the right-hand side. 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)
3-82
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.
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
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:
3-85
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
3-86
WO R K I N G W I T H P R O J E C T S Using Browser
application, also all tabs can be viewed separately, you may set up Browser according your need by hiding the desired tabs.
box appears. 2 In the Browser tab, change the Browser Position property to Right or Left.
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.
Click the Containment Tree tab in the upper side of the Browser.
3-87
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.
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
Options dialog box appears. 2 In the Browser tab, set the Show Full Types in Browser check box to true (default false).
In the Containment Tree tab, click the Show Stereotypes in Browser button
Options dialog box appears. 2 In the Browser tab, set the Show Stereotypes in Browser check box to true (default false).
In the Containment Tree tab, click the Show Code Engineering Sets button Options dialog box appears.
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.
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).
shortcut menu or open the Code Engineering Sets dialog box and click the New button. The New Set dialog box appears. 2 Type the set name and select programming language from the drop-down list (by default - Java). 3 Click OK to finish set creation.
3-89
WO R K I N G W I T H P R O J E C T S Using Browser
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.
For the detailed descriptions about the reverse, see Section Reverse in the Code Engineering Users Guide.
TIP!
For the detailed descriptions about the reverse, see Section Reverse in the Code Engineering Users Guide. All above listed functions can be performed in the Code Engineering Sets dialog box.
3-90
WO R K I N G W I T H P R O J E C T S Using Browser
2 Select the directory where the text editor is located and Arguments. 3 Click OK.
The classpath is defined in the Project Options dialog box, Java Language Options pane.
Diagrams tree
The Diagrams tree in the Browser represents a diagrams external structure.
In the Diagrams tree, with the selected diagrams, you may perform the operations listed below.
From the shortcut menu, select the Group by Diagram Type check box.
3-91
WO R K I N G W I T H P R O J E C T S Using Browser
Also in the Diagram Specification dialog box you may add documentation of the diagram, define steretypes, contraints and tagged values, view ther relationships in which the diagram participates, and difine hyperliks.
Choose Print from the diagram item shortcut menu. If the diagram is empty, it will not be printed.
Also there are other ways for printing diagram. For more details about printing, see Section Printing on page 4-165.
Inheritance tree
The Inheritance tree represents classes, packages, interfaces, primitive data types hierarchy of your project. The inheritance according UML Specification is shown using generalization relationship.
3-92
WO R K I N G W I T H P R O J E C T S Using Browser
For more information about managing model elements from the Browser, see Section Working with model elements in the Browser tree on page 3-95.
In the Inheritance Tree tab, click the Show Stereotypes in Browser button
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.
From the Model Extensions Tree shortcut menu, select the Group by Profiles check box.
3-93
WO R K I N G W I T H P R O J E C T S Using Browser
In the Model Extensions Tree, click the Group by Base Class button
From the Model Extensions Tree shortcut menu, select the Group by Profiles check box.
S e a r c h Re s u l t s Tr e e
The Search Results tree shows results of the search, which may be performed through the Find dialog box.
From Diagrams - shown are those elements that are displayed on the diagram(s). From Model - shown are those elements that are created in the model data.
To open the Find dialog box, from the Search Results Tree
Click the Find button , or press CTRL+F keys.
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.
You may draw a symbol by dragging and dropping an item to the Diagram pane
elements that you would not like to appear in the Browser tree
3-95
WO R K I N G W I T H P R O J E C T S Using Browser
Multiple selection
A group of model elements can be selected within the Browser tree, and you may edit all the selected model elements at the same time.
Hold down the SHIFT key and click the last element you wish to include in to multiple selection. For more precise selection, hold down the CTRL key and click (while holding the key down) with the mouse on the elements you wish to select.
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.
3-96
WO R K I N G W I T H P R O J E C T S Using Browser
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.
3-97
WO R K I N G W I T H P R O J E C T S Using Browser
PROPERTIES TAB Since MagicDraw version 8.0, you may edit model elements and diargram properties such as data, sybol properties, language properties directly from in the Browser, Properties tab. Properties tab has two modes - Standard ant Expert. Depending on your needs you may choose one of them.
3-98
WO R K I N G W I T H P R O J E C T S Searching
SEARCHING
MagicDraw search mechnism enables the serch within model elements data, symbols, and extensions. You may also search for usages and dependant elements of the selected elements. This functionality is described in Section Usages functionality on page 4-146 and in Section Dependent Elements functionality on page 4-146.
TIP!
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!
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
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.
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
WO R K I N G W I T H P R O J E C T S Searching
+ 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)
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
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
http://java.sun.com/docs/books/tutorial/extra/regex/index.html
Ra t i o na l Ro s e
To prepare Rational Rose for XMI exchange
1 Download Rose 2001a/2002 XMI support add-in at
ftp://www6.software.ibm.com/software/developer/library/rational/2834/Rose/ RoseXMLTools1.3.6.01.zip 2 After you have installed XMI support for Rational Rose, two new menu items Export Model to UML and Import UML Model appears under Tools menu. These items are for XMI exchange.
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
3 From the Output File Basis group box, select the Model option button. 4 Click OK.
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.
Open. 3 The Rose UML Import Options dialog appears, click OK.
MagicDraw
To export MagicDraw project to Rose supported XMI format
1 Open the project file you want to export to XMI format. 2 From the File menu, choose the Export As Unisys XMI. 3 The Save dialog box appears. Type the name of the project and choose the
Open button.
3-106
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).
Collaboration diagram
3-107
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.
Activity diagram
3-108
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.
3-109
To g e t he r C on t r o l C e n t e r
To export the Together ControlCenter project to Unisys XMI Extensions file.
1 From the File -> Export menu, choose the Model to XMI File command. 2 The Export to XMI dialog box appears. Select the XMI 1.0 for UML 1.3 (Unisys
Extension) option button from the Select XMI Type group box.
While exporting: XMI 1.0 for UML 1.3 (Unisys Extension) check box should be selected.
3-110
2 The Select XML Document dialog appears, choose the desired XML file and
MagicDraw
To export MagicDrawTM UML project to Unisys XMI format
1 Open the project file you want to export to XMI format. 2 From the File menu, choose the Export as Unisys XMI. 3 The Save dialog box appears. Type the name of the project and choose the
3-111
2 The Open dialog box appears. Choose the desired project file and click the
Open button.
Field Common
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
3-112
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
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
WO R K I N G W I T H P R O J E C T S Resources Manager
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:
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
3-114
WO R K I N G W I T H P R O J E C T S Resources Manager
ID Category State
3-115
WO R K I N G W I T H P R O J E C T S Resources Manager
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
Import
NOTE
If resource requires fee-paying, in the Resource Manager window, the Price column price of the particular resource is displayed.
3-116
WO R K I N G W I T H P R O J E C T S Resources Manager
3-117
WO R K I N G W I T H P R O J E C T S Resources Manager
3-118
DIAGRAMS BASICS
This chapter offers an overview of working with diagrams. In general, the topics discussed apply to all the supported diagram types. Concepts that can be useful:
A 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.
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.
Using toolbar buttons: Click the desired diagram button on the toolbar. The Create Diagram dialog box
4-120
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
Load all Diagrams opens all diagrams that are created in the project. Load Only Opened Diagrams opens only diagrams that were not closed in earlier usages of the project. Do not Load Diagrams all diagrams are closed after opening a project.
To close diagram
Click the Close Diagram button on the diagram pane or choose Close Diagram from the diagram shortcut menu. Define a diagram in the corresponding Diagram Specification dialog box. Diagram Specification dialog box
Refer to the Section Specification dialog boxes on page 4-133 for the information of this specification elements.
To rename a diagram
In the corresponding Diagram Specification dialog box, enter a new diagram name.
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.
4-123
D i a g r a m Pr o p e r t i e s
Customize the diagram style (color, grid) in the Diagram Properties dialog box.
Choose Diagram Properties from the diagram shortcut menu. The Properties dialog box appears. From the Edit menu, choose Symbol, and then choose Diagram Properties. Press SHIFT+ENTER.
Show Grid Snap Paths to Grid Snap Shapes to Grid Grid Size
4-124
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.
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
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
4 Standard Mode contains the following fields that will be shown in the table:
Author, Creation date, and Modification date and all other tag definitions that can be assigned to the diagram. In the field Custom Mode, you may create your own table or any other object in HTML. 5 Preview the selected table or other created object in the Preview pane.
DRAWING SHAPES
To draw a shape on the Diagram pane
1 Click the shape button on the diagram toolbar, or press the appropriate
shortcut keys for the shape you wish to draw (the button remains pressed). For a detailed description of diagram toolbars, see Section Toolbars on page 9-447. 2 Click the desired location on the diagram pane. The new shape is placed on the diagram pane at the point you click. Create the desired model element in the Browser tree. From the created item shortcut menu, choose Create Symbol or drag and drop the selected model element to the diagram pane.
shortcut keys for the shape you wish to draw (the button remains pressed.) Click the Sticky button on the diagram toolbar (shortcut keys Z or CTRL+SHIFT+Z.) Click the desired location on the diagram pane. The new shape is placed on the diagram at the point you click (the button remains pressed.) Click the next location on the diagram pane. The next shape is placed on the diagram pane. Repeat this until you draw a desired number of shapes. To undo, click the Sticky button on the diagram toolbar (shortcut keys Z or CTRL+SHIFT+Z.)
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
Type the shape name directly on the selected shape on the Diagram pane. Type the shape name after slow double-clicking the shape in the Browser tree.
From the shortcut menu of the desired item in the Browser tree, choose the Create Symbol command. Or, drag and drop the selected model element onto the diagram pane. Type the same name for multiple shapes directly on the shape after the text cursor appears in that area.
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.
dialog box, you will receive an error message notifying you of the existence of the current name of the shape. You may not specify a name for a new shape if another shape of the same name and kind is already present in the package.
4-127
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
4-128
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.
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.
4-129
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.
4-130
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
box appears. 2 In the Diagram pane, set the Use Smart Manipulation check box to False and click OK.
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.
number of shapes.
4-131
Drag the cursor diagonally across the area you wish to select. All shapes in the selected area will be selected.
D R A G G IN G , C O P Y I N G , C UT T I N G , A N D P A S T IN G
Move a shape to another place on the diagram pane by dragging-and-dropping.
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.
You may copy/paste many (but not all) model elements among various diagrams.
To paste one or more copied model element by creating new data and symbols
From the Edit menu, choose the Paste With New Data command (shortcut keys CTRL+E.)
4-132
(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.
properties directly from the Browser, Quick Properties tab. More about this functionality, read in Section Properties tab on page 3-98.
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
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.
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.
4-134
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
TAGGED VALUES
TAB
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
Group By Stereotype Displays that types of tag definitions in the list. Show Tag Definitions Types
4-136
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
CONSTRAINTS
TAB
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.
4-138
GENERAL
TAB
Type or view the model element name. If you enter the name of the already existing model element, an error message box appears.
For some model elements (for example attribute, operation, etc.), the default name Untitled
Documentation is a comment associated with the selected constraint. To edit the comment, click the button, the Comment Specification dialog box appears. Edit the name, add stereotypes, tagged values, and/or constraints to the comment. Also you may write documentation in HTML format. Just select the HTML check box and menu with available text formatting buttons appears.
Button 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
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
4-140
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
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.
4-142
HYPERLINKS TAB In the Hyperlinks tab, manage the hyperlinks you want to add to the model element.
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
BUTTONS
AVAILABLE IN THE
SPECIFICATION
DIALOG BOXES
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.
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.
4-144
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.
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
MODEL TRACEABILITY
Usages / Dependencies functionality allows to track/view element dependencies in the UML model. Usages and Dependent Elements functionality will help you to find information how model elements are used by another elements, what are relations between used and dependent elements. Usages and Dependent Elements functionality is very useful for analyzing associations between elements or searching for diagrams where these elements are represented. The Usages / Dependent Elements results window is not synchronized with model. So, if there were made some actions with model elements, the Refresh button must be pressed in order to synchronize it.
Usages 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.
4-146
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.
Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements Options dialog box appears.
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
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.
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.
Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements dialog box appears. Click OK.
2005 No Magic, Inc
4-148
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.
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
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.
Defining Hyperlinks
You may set text for notes, text boxes, or separators as HTML text. Also you may hyperlinks to any model element.
NOTE
Hyperlink dialog box. If you want this hyperlink to be active, click the Active Hyperlink check box. 3 Click OK. The hyperlink is added as a tag definition.
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.
4-150
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:
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
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
3 Select the text where you want to add hyperlink and click the Insert Hyperlink
button.
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 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.
4-152
Tab name
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.
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.
Orthogonal Layouter
2005 No Magic, Inc.
4-153
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
4-154
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
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
Values
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.
4-156
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
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.
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.
0-360
360
Integer 0.1-0.9
50 0.5
4-157
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.
Boolean
True
-0.2-2
Path Attraction
0-2
2 0 True
False
0-1
0.2
4-158
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.
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.
Boolean
True
Integer
200
0-360
340
4-159
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.
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.
4-160
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
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.
0-1
Boolean
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.
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.
4-162
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 .
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!
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 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
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.
box appears. 2 From the Grid Style drop-down list box, select one of the following style of the grid: Dense
Sparse (default)
pane of the dialog box. For more information about Keyboard pane Section Keyboard pane on page 2-36.
4-164
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.
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
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
4-166
PRINT OPTIONS TAB Click the Print Options tab to customize the printing jobs.
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
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.
Use any text and combine it with these variables box - indication how to insert some fields in the header/footer. Customize header group box - prints header. Select the Print Header check box and type the text you wish to be printed, also choose the desired font. Customize footer group box - prints footer. Select the Print Footer check box and type or change the text you wish to be printed also choose the desired font. By default <$PageNumber$> <$FileName$> <$DiagramName$> <$Date$> <$Time$> is printed.
4-168
Notation
(H)
Constraint NOTE To select a constraint, right-click the Note Anchor button. Separator (W) (SHIFT+H)
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
Constraint path
For two graphical symbols (such as two classes or two associations), the constraint is shown as a dashed arrow from one element to the other element. The constraint is labeled by the constraint string (in braces {}). The direction of the arrow is relevant information within the constraint. The client (tail of the arrow) is mapped to the first position and the supplier (head of the arrow) is mapped to the second position in the constraint.
Choose <new>. The Constraint Specification dialog box appears. Fill in the dialog box. Choose 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.
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.
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
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
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
However, MagicDraw has only 7 diagram buttons in the application. This is done to simplify the user interface and allow for more flexibility. Object and collaboration diagrams are supported by MagicDraw collaboration diagram. However it is possible to draw objects in the class diagram, node and component instances in the implementation diagram. Component and deployment diagrams are supported by MagicDraw implementation diagram which allows you to draw both kinds of diagrams (or mix of them) on the same canvas. It possible to distinguish model management diagrams that are supported by MagicDraw class diagram.
5-174
SYSTEM VIEWS
Most UML literature (Instant UML, UML Toolkit, The Unified Modeling Language Reference Manual) define more or less similar classification for the system views:
Several kinds of diagrams provide a visual notation for the concepts in each view.
Log i c a l V i e w
The logical view represents both the static and dynamic aspects of a system in terms of class and objects. In contrast to the use case view, the logical view looks inside the system. Static structure is displayed on Class and Package diagrams, and the main goal of these diagrams is to represent a systems class structure: The development of the static structure relies on abstraction, encapsulation, and uniformity. The class diagram finally results in the code structure. The dynamic behavior of the system is displayed on Interaction (sequence and collaboration), Statechart, and Activity diagrams. It focuses mainly on the interactions that occur between objects inside a system, activities and work performed by the various parts of a system, and state changes within a particular object or collaboration. Rather than defining the participants of the system, it defines how particular use cases are executed, which provides value for the external user. The dynamic view is concerned about what is happening inside the system and how those actions impact other participants.
5-175
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
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
(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)
5-178
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.
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
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.
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)
5-180
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.
Notation
(SHIFT+C)
(G)
Realization (realize) A relationship usually used between an interface and implementation class.
(R)
5-181
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.
Notation
(D)
(T)
(U)
(B)
(J)
Link Attribute Visual tie between parts of association class association part and class part.
(L)
(SHIFT+S)
5-182
Classes
A class is drawn as a solid-outline rectangle with three compartments separated by horizontal lines. The top name compartment holds the class name and other general properties of the class (including stereotype); the middle list compartment holds a list of attributes; the bottom list compartment holds a list of operations. The attribute and operation compartments are optional and you may suppress them. A class is the descriptor for a set of objects with similar structure, behavior, and relationships. The model is concerned with describing the intention of the class, that is, the rules that define it. The run-time execution provides its extension, that is, its instances. Classes are declared in class diagrams and used in most other diagrams. UML provides a graphical notation for declaring and using classes, as well as a textual notation for referencing classes within the descriptions of other model elements. A class represents a concept within the system being modeled. Classes have data structure, behavior, and relationships to other elements. The name of a class has scope within the package in which it is declared and the name must be unique (among class names) within its package. WORKING WITH CLASSES General information about working with shapes is offered in Chapter 4, "Diagrams Basics." All options associated with a class can be set in the Class Specification dialog box. Class Specification dialog box
5-183
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
5-184
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 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.
menu. The Class Specification dialog box appears. 2 Select the Abstract, Leaf, Root, and/or Active check box in the General tab.
5-185
Interface
An interface is a specifier for the externally-visible operations of a class, component, or other classifier (including subsystems) without specification of internal structure. Each interface often specifies only a limited part of the behavior of an actual class. The set of interfaces realized by a classifier are its provided interfaces, which represent the obligations that instances of that classifier have to their clients. They describe the services that the instances of that classifier offer to their clients. To display provided interface, from class to interface draw realize relationship (attributes and operations of the interface should be suppressed).
Interfaces may also be used to specify required interfaces, which are specified by a usage dependency between the classifier and the corresponding interfaces. Required interfaces specify services that a classifier needs in order to perform its function and fulfill its own obligations to its clients. To display required interface, from class to interface draw usage relationship (attributes and operations of the interface should be suppressed)
Working with interface is similar to working with classes. For more information, see Section Working with classes on page 5-183. General information about working with shapes is offered in Chapter 4, "Diagrams Basics." All options associated with a interface can be set in the Interface Specification dialog box.
5-186
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
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.
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
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.
Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears. Click the Attributes tab and then click the Add button. The Attribute Specification dialog box appears. Define a new attribute and click OK. Choose the Insert New Attribute from the class shortcut menu. Type attribute name directly on the class shape. In the Browser tree, choose already created class. From the class item shortcut menu, choose New and then choose Attribute.
dialog box. 2 In the Attributes tab, double-click the desired attribute in the list, or click the Edit or Add button. In the Association End Role Specification, and Association End Role Specification dialog boxes, Details tab, Qualifiers group box, click the Add or Edit button.
5-188
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.
Type Modifier
Changeability
5-189
Tab name
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
5-190
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.
tree. 2 Type a new name. Change an attribute name in the Attribute Specification dialog box.
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.
& - 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
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.
1 Open the Attribute Specification dialog box. 2 From the Visibility drop-down list box, choose the desired item (public, package, NOTE
Classifier.)
addOnly
Choose changeable, frozen, or addOnly from the drop-down list box in the Attribute Specification dialog box.
5-192
Operation
Entries in the operation compartment are strings that show operations defined on classes, as well as operations supplied by classes. An operation is a service that an instance of the class can be requested to perform. It has a name and a list of arguments. Usually class attributes are accessed through operations. Operations are used to perform specific actions, such as system calls, utility functions, and queries. The operation signature provides all information needed to use that operation.
Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears. Click the Operations tab and then click the Add button. The Operation Specification dialog box appears. Define a new operation and click OK. Choose the Insert New Operation from the class shortcut menu. Type operation name directly on the class shape. In the Browser tree, choose already created class. From the class item shortcut menu, choose New and then choose Operation.
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
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
Concurrency Query
5-194
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
Direction kind
tree. 2 Type a new name. Change an operation name in the Operation Specification dialog box.
In the Attribute Specification dialog box, the Return Type drop-down list box, choose the return type of an operation .
5-195
Type a colon : and the name of the type of an operation just after the operation name on the diagram pane. If you specify a nonexistent type of an operation, a new class is created.
a parameter and click the Edit or Add button. The Parameter Specification dialog box appears. Type a parameter text (in parenthesis) directly on a diagram.
Select an operation in the Browser tree, choose New from its shortcut menu and choose Parameter. The Parameter Specification dialog box appears.
Parameter Specification dialog box The Parameter Specification dialog box defines operations argument.
5-196
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
& - 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-197
1 Open the Operation Specification dialog box. 2 From the Visibility drop-down list box, choose Public, Package, Private, or NOTE
Guarded
Concurrent
Choose the concurrency type in the Concurrency drop-down list box in the Operation Specification dialog box.
5-198
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.
shortcut menu. The Class Specification dialog box appears. Click the Template Parameters tab. 2 To add or edit a parameterized class, click the Add button. The Template Parameter Specification dialog box appears. Type the name of the parameter, choose the type from the Type drop-down list box and set the default value by selecting a model element in the Select Model Element dialog box. 3 To remove the selected parameterized class, click the Remove button.
Tab name General Set general information about the template parameter
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
Po r t
Ports represent interaction points between a classifier and its environment. The interfaces associated with a port specify the nature of the interactions that may occur over a port. The required interfaces of a port characterize the requests which may be made from the classifier to its environment through this port. The provided interfaces of a port characterize requests to the classifier that its environment may make through this port. A port has the ability to specify that any requests arriving at this port are handled. Class model element and Component model elements may have any number of Ports. When port is created, new class for port definition is created in the same package as source class. Port class name by default is Port_<incremental number>. Define a port in the Port Specification dialog box. Port Specification dialog box
5-200
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
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
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:
5-202
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
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
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.
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.
5-204
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.
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
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.
Choose Presentation Options from the class shortcut menu. The following choices are available in the Presentation Options submenu. Class presentation options you may also define in the Project Options dialog box. For a detailed description of this dialog box, see Section Project Options on page 3-51.
5-206
Command
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
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.
5-208
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
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
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.
Subsystem
A subsystem is treated as an abstract single unit. It groups model elements by representing the behavioral unit in a physical system. A subsystem is defined as a package, and it includes operations, specification elements, and realization elements. Specification elements define unit behavior and interaction with other subsystems. Specification elements include interfaces, use cases, constraints, relationships between use cases, etc. Realization elements realize subsystem behavior. Realization elements include various kinds of classifiers and their relationships. A subsystem is presented as a package with a fork symbol placed in the upper right corner of the small rectangle. The large rectangle has three compartments. One is for operations, one for specification elements, and one for realization elements. A subsystem is defined as a package it has package properties in the Subsystem Specification dialog box. For a detailed description of packages, see Section Packages on page 5-208.
5-210
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
Tab name
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.
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.
5-212
Model
A model is an abstraction of a physical system from a particular point of view. A model contains a hierarchy of packages/subsystems and other model elements that describe the system. A model is presented as a package with a small triangle in the upper right corner of the large rectangle. The triangle can be shown in the tab. A model is defined as a package it has package properties - in the Model Specification dialog box. For a detailed description of packages, see Section Packages on page 5-208. Model Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section..
Tab name Box 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
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
5-214
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
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.
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
You may edit the assigned instance in the Collaboration Specification dialog box, Instances tab.
Generalization
Generalization is the relationship from the child element (the more specific element, such as a subclass) to the parent (the more general element, such as a superclass) that is fully consistent with the first element and that provides additional information. Generalization is used between elements of the same kind, such as classes, packages, use cases, but never for instances, such as an object. MagicDraw is not yet adapted to draw generalization between associations. A generalization is shown as a solid-line path from the child element (the more specific element, such as a subclass) to the parent element (the more general element, such as a superclass), with a large hollow triangle at the end of the path where it meets the more general element. Generalization lines can be combined into trees. For more general information about working with symbols, see Chapter 4, "Diagrams Basics." Define the generalization in the Generalization Specification dialog box.
5-216
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.
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.
5-217
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
For general information about working with symbols, see Chapter 4, "Diagrams Basics." Specify an association in the Association Specification dialog box. Association Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name 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
5-219
Tab name
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.
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.
path.
ASSOCIATION END An association end is simply an end of an association where it connects to a classifier. It is part of the association, not part of the classifier. Each association has two or more ends. An association end is not a separable element it is just a mechanical part of an association.
appears. 2 Click the Name button in the Association End A or B group box. A or B depends on which classifier playing role you wish to define (class A association path target, class B source). From the association end shortcut menu, choose Specification.
5-220
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
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
5-222
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
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.
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
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.
private.
box. Open the Association Specification dialog box and from the Multiplicity dropdown list box, choose or type the multiplicity value for the desired association end.
From the association shortcut menu, choose Role A of (class name) or Role B of (class name), and from the Multiplicity drop-down list box, choose the multiplicity value (1, *, 0..*, etc.)
5-224
AddOnly
box.
Define a qualifier. 3 To remove a qualifier, click the Remove button. In the Association End Specification dialog box, you may also define association end scope, type modifier, or set association end as ordered.
Re a l i z a t i o n
A realization relationship is a relationship between two descriptions of the same thing between specification and its implementation but at different levels of abstraction. A realization is used to show an interface implementation. The realization means that the client element must support all the behavior of the supplier element but need not match its structure or implementation. Realization relationships are drawn as a dashed line with a solid triangular arrowhead (a dashed generalization symbol). The client (the one at the tail of the arrow) supports at least all of the operations defined in the supplier (the one at the arrowhead), but without the necessity of supporting the data structure of the supplier (attributes and associations).
5-225
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
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.
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.
5-226
For more general information about working with the symbols, see Chapter 4, "Diagrams Basics." ABSTRACTION An abstraction is a Dependency relationship that relates two elements or sets of elements that represent the same concept at different levels of abstraction or from different viewpoints. Define an abstraction in the Abstraction Specification dialog box. Dependency and its kinds Specification dialog boxes Abstraction, usage, dependency, and permission relationships are defined in the same dialog box. Differs from one another only corresponding name and different predefined stereotypes.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name 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
Define a binding dependency in the Binding Specification dialog box. 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.
Edit
PERMISSION Permission is a kind of dependency. It grants a model element permission to access elements in another namespace.
5-228
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
Containment
A containment shows a class, package or other model element declared within another model element. Such a declared class is not a structural part of the enclosing class but merely has scope within the namespace of the enclosing class, which acts like a package toward the inner class.
U S E C A S E D I A G RA M
A use case is a description of the functionality (a specific usage of a system) that a system provides. The use case descriptions may exist in textual form (simple table), where the use case diagram provides additional information about the relationship between use cases and external users. The diagram also allows definition of the systems boundary. Use cases are described only as viewed externally by the user (a systems behavior as the user perceives it), and do not describe how the functionality is provided inside the system. Use cases are not object oriented, but they are included in the UML to simplify the approach of the projects lifecycle -- from specification to implementation.
5-230
(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
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.
Notation
(Q)
(S)
(E)
(C)
(D)
5-232
Element Generalization A relationship between a more general and a more specific element.
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
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements.
From the actor shortcut menu, choose Presentation Options, and then select/clear the Suppress Attributes and Suppress Operation check boxes. From the actor shortcut menu, choose Symbol(s) Properties. The Properties dialog box appears. Select/clear the Suppress Attributes and Suppress Operation check boxes. From the Options menu, choose Project. The Project Options dialog box appears. Select an actor and select/clear the Suppress Attributes and Suppress Operation check boxes. Click Apply, if you want to apply changes for other already created actors.
To analyze an actor
From the actor shortcut menu, choose Tools, and then Analyze. For a detailed description, see Section Tools for Analysis on page 7-417.
To generate operations for setting or getting private data to the selected class
From the actor shortcut menu, choose Tools and then Create Setters/Getters. For a detailed description, see Section Creating Setters / Getters on page 7-438.
5-234
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
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
For more general information about working with symbols, see Chapter 4, "Diagrams Basics."
5-236
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.)
Flow of Events
Identity
Other IMPORTANT
5-237
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.
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.
5-238
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.
case shape. The Use Case Specification dialog box appears. 2 Open the Extension Points tab and the Edit or Add buttons.
5-239
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.
5-240
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
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
COLLABORATION DIAGRAM
Collaboration diagram shows an interaction organized around roles. A collaboration diagram presents a collaboration that contains a set of instances, as well as their required relationships given in a particular context. The diagram also presents an interaction that defines a set of messages specifying the interaction between the classifier roles within a collaboration to achieve the desired result. A collaboration diagram is given in two different forms: at the instance level or at the specification level; it shows either Instances, Links, and Stimulus, or ClassifierRoles, AssociationRoles, and Messages.
Instance level
The instance level (or context) is defined in terms of a static structure of instances and the relationships between them. Instances have to be assigned to a classifier: either to a class (object), a use case (use case instance), or an actor (actor instance). The structural part (more precisely the representation of it) is sometimes called object diagram.
S p e c i fi c a t i o n l e v e l
At the specification level, the diagram shows behavioral elements - ClassifierRoles, AssociationRoles - and Messages among them. Behavioral elements are dynamic interactions that show sequence of messages exchanged by objects over time. A collaboration diagram shows objects interactions organized around the objects and their relationships to each other. The 3D interaction model shows that the collaboration diagram is the model projection to the bottom.
5-242
5-243
(I)
(O)
(U)
(B) Link An instance of an association between classifiers. Every link among instances of particular classifiers should have corresponding association between corresponding classifiers. Link to Self An instance of association. Self link for self-calls. It begins and ends on the same instance. Classifier Role A classifier role is a specific role played by a participant in a collaboration. It specifies a restricted view of a classifier, defined by what is required in the collaboration. Association Role Association roles describe the required links between the instances, i.e. a subset of the existing links.
(L)
(S)
(C)
(A)
5-244
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.
(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
To open the Instance, Object, Use Case Instance, or Subsystem Specification dialog box
Choose Specification from the appropriated instance shortcut menu or double-click the instance shape.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name 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.
5-246
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 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.
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.
5-247
Edit dialog box appears. Select attributes to be visible on the instance shape. The Suppress Attributes and Edit Compartment commands are available only when the assigned classifier contains at least one attribute.
To reduce a diagrams complexity, instances of class (objects) that are made of sub-objects can be represented as a composite object.
remains pressed). Click the Sticky button on the diagram toolbar or press shortcut keys: Z, SHIFT+CTRL+Z. Click on the desired place in the Diagram pane. The new object is placed on the diagram. Click on the created object on the Diagram pane. The new object is placed on the composite object. Repeat this until you draw the desired number of objects. Click the Sticky button on the diagram toolbar or press shortcut keys Z, SHIFT+CTRL+Z. Drag already created objects to your target object.
Link
A link represents a connection between two or more instances of class, interface, actor, and use case. A link is an instance of an association. Through this connection, instances send and receive messages and data. A link end is an instance of association end. For more general information about working with symbols, see Chapter 4, "Diagrams Basics." Define the selected link in the Link Specification dialog box.
5-248
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
Tab name
Function The Stimulus Specification dialog box appears. Edit the stimulus. Removes the selected stimulus.
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
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
5-250
Classifier role
A classifier role is a specific role played by a participant in a collaboration. It specifies a restricted view of a classifier, defined by what is required in the collaboration. The role describes the type of Object that may play the role, such as required Operations and Attributes, and describes its relationships to other roles. The relationships to other roles are defined by Association Roles. A Classifier Role is shown using a rectangle symbol. For more general information about working with symbols, see Chapter 4, "Diagrams Basics." Define the selected classifier role in the Classifier Role Specification dialog box. Classifier Role Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name Box 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
roles shortcut menu. 2 Choose the classifier you wish to assign to a classifier role.
shortcut menu. 2 The Classifier Role Specification dialog box appears. To assign a new base classifier, click the Base Classifier drop-down button. The list with classifiers appears. Select a classifier you wish to assign to a classifier role.
To edit already created classifier, click the Edit Base button. The corresponding to a classifier Specification dialog box appears.
NOTE
shortcut menu. 2 The Classifier Role Specification dialog box appears. 3 Select the multiplicity indicator from the Multiplicity drop-down list box or type your own indicator. If you create a classifier role and set a multiplicity with an unbounded limit * the classifier role is drawn as a multiple object.
Association role
Relationships between classifier roles are defined by association roles. An association role is shown with the usual association line. The name string of the association role follows the same syntax as for the classifier role. If the name is omitted, a line connected to classifier role symbols denotes an association role. For more general information about working with symbols see, Chapter 4, "Diagrams Basics." Define the selected association role in the Association Role Specification dialog box.
5-252
role shortcut menu. The Association Role Specification dialog box appears. 2 In the Association End Role A or Association End Role B group box, click the Name ... button. The Association End Role Specification dialog box appears. Specify the association end role and click OK. Right-click the association end role name. Specify some options in the shortsut menu, or choose the Specification command to open the Association End Role Specification dialog box. Association Role Specification dialog box
5-253
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.
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.
Remove
Stimulus / Message
In a collaboration diagram, a Stimulus is a communication between two Instances that conveys information with the expectation that action will ensue. A Stimulus will cause an Operation to be invoked, raise a Signal, or cause an Instance to be created or destroyed. A Message is a specification of a Stimulus, i.e. it specifies the roles to which the sender and the receiver Instances should conform, as well as the Action which will, when executed, dispatch a Stimulus that conforms to the Message.
5-254
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.
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
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.
5-256
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.
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
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.
appears. 3 Choose the action type from the Type drop-down box. See Section Actions on page 5-260.
Numbering command.
5-258
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
All of the sequence numbers with the same prefix form a sequence. The numerical predecessor is the one in which the final term is one less. That is, number 3.1.4.5 is the predecessor of 3.1.4.6, where the number 3 is an activator.
Choose 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.
and predecessors. If you change the activator number to one of the predecessor message, this number also changes for other predecessors.
Define the selected stimulus in the Stimulus Specification dialog box. For a detailed description of this dialog box, see Section Stimulus Specification dialog box on page 5-257. Define the selected message in the Message Specification dialog box. For a detailed description of this dialog box, see Section Message Specification dialog box on page 5-256.
Actions
An action is a specification of an executable statement that forms an abstraction of a computational procedure, resulting in a change in the state of the model. It can be realized by sending a message to an object, or by modifying a link or a value of an attribute. Specify assigned actions in the Action Specification dialog box.
In the 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.
5-260
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
5-261
Tab name
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.
Asynchronous Arguments An argument is an expression describing how to determine the actual values passed in a dispatched request. Expression Edit Add Remove
5-262
ACTION
TYPES
Action Type
Description
Characteristics
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
Call
Send
Destroy
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.
Terminate
Message
Assignment
Message
Set the following features for an action in the Action Specification dialog box.
5-263
Description An expression which states how many times the Action should be performed.
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.
dialog box. An active class is shown as a rectangle with heavy borders. 2 Create an instance of this class as an active object.
5-264
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
(O)
Activation Bar Focus of control. Shows the period during which an object is performing an action either directly or through a subordinated procedure. Interaction Use Reference to collaboration diagram, sequence diagram and time diagram can be created. Combined Fragment A fragment of sequence diagram can be separated.
(SHIFT+T)
(F)
5-266
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
Notation
(M)
(S) Diagonal Message Requires some time to arrive, during which another action occurs.
(D)
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
Define the selected association role in the Classifier Role Specification dialog box. For a detailed description of this dialog box, see Section Classifier Role Specification dialog box on page 5-251. For more information on working with classifier roles, see Section Classifier role on page 5-251.
Interaction Use
Interactions are units of behavior of an enclosing Classifier. Interactions focus on the passing of information with Messages between the ConnectableElements of the Classifier. Reference to collaboration diagram, sequence diagram and time diagram can be created.
5-268
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.
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
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
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.
5-270
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.
After resizing, the lines on an activation bar are thickened and the size of an activation bar may not change automatically.
The lifeline may split into two or more concurrent lifelines to show conditionality. Each corresponds to a conditional branch in the message flow. Lifelines may merge together at some subsequent point.
5-271
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.
5-272
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
5-273
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
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.
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
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.
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)
5-276
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.
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
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
5-278
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
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
Tab name
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.
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.
5-280
State Specification dialog box The description of this dialog box is the same as Final 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.
5-281
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.
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 remove any region from the concurrent state (at least two regions have to be left)
Choose Remove Region from the concurrent state shortcut menu and choose a region you want to remove.
Submachine
A submachine state represents the invocation of a state machine defined elsewhere.
5-282
The submachine state is depicted as a normal state with the appropriate include declaration within its internal transitions compartment. As an option, the submachine state may contain one or more stub states, which represent already created states. For more general information about working with symbols see, Chapter 4, "Diagrams Basics." Define the selected submachine in the Submachine State Specification dialog box. Submachine State Specification dialog box
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name 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.
5-283
Tab name
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.
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. .
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.
5-284
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.
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
Ps e u d o S t a t e s
A pseudostate is an abstraction that encompasses different types of transient vertices in the state machine graph. They are typically used, to connect multiple transitions into more complex state transitions paths. Specify pseudostates in the Pseudo State Specification dialog box.
NOTE
Any transition from the pseudostate does not contain a trigger event.
INITIAL STATE Every object is in some particular state as soon as it is created, so it is useful to explicitly show that state. A solid filled circle represents the initial state of an object. There can only be one initial state for an object. An initial state denotes the starting place for a transition, the target of which is a composite state. FINAL STATE To represent the objects destruction, use the final state symbol (a circle surrounding a smaller solid circle). The final state is optional in the diagram because there is a system that runs without interruption after the start of the activities. Also, there can be several final states in the same state diagram, denoting that the objects life may finish depending to several conditions. HISTORY STATE A history state serves for internal state memorizing, indicating that the enclosing composite state remembers its previously active substate after it exits. A deep history state is used to remember a state that has been nested at some depth within a composite state. A shallow history state is used to remember a state that is at the same nesting depth as the history state itself.
History state can be a deep history state (with a letter H) or of shallow history state (with a letter H). By default deep history shape is drawn.
5-286
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.
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.
5-287
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.
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
5-288
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 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
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
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
EVENT
TYPES
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
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.
5-290
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
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.
menu. The Transition Specification dialog box appears. 2 Click the Source/Target ... button.
5-292
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.
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.
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
the transition path. The Transition Specification dialog box appears. 2 Click the Edit button in the Guard group 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
5-294
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
(A)
(S)
(K)
(C)
(M)
5-296
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.
Notation
(Q)
(SHIFT +T)
(I)
(F)
(SHIFT +F)
(T)
5-297
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.
Notation
(B)
(V)
(SHIFT +I)
(SHIFT +O)
(D)
5-298
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.
Notation
(P)
(O)
(SHIFT +B)
(SHIFT +D)
Action state
Action state is sometimes called an activity. An action state is a shorthand for a state with an entry action, plus at least one outgoing transition involving the implicit event of completing the entry action. There can be several such transitions if they have guard conditions. An action state is performed to produce a result, to describe an implementation of an operation. The transition triggers as soon as all activities in the action state are performed. An action state is shown as a shape with a straight top and bottom and with convex arcs on the two sides. The action-expression is placed in the symbol. For more general information about working with symbols see, Chapter 4, "Diagrams Basics." Define the selected action state in the Action State Specification dialog box.
5-299
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
5-300
Tab name
Function The Event Specification dialog box appears. Define an event. Remove the defined event
menu. The Action State Specification dialog box appears. 2 Select the Dynamic check box, found on the bottom of the dialog box.
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.
menu. The Action State Specification dialog box appears. 2 Type an argument in the Arguments text box.
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.
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
Call State
A call state is an action state that has exactly one call action as its entry action. It is useful in object flow modeling to reduce notational ambiguity over which action is taking input or providing output.
choose Assign. 4 In the appeared Assign State/Activity Diagram dialog box, click New and select State Diagram or Activity. 5 Type State/Activity diagram name and close all dialogs by clicking OK. 6 In the created State/Activity diagram, draw a call state and open the Call State Specification dialog box, the Detail tab. 7 Click the Edit button in the Actions group box. The Call Action Specification dialog box appears. 8 From the Operation drop-down list box, select the desired operation. 9 Click OK in all previous dialog boxes. Operation that a call state invokes will appear on the call state shape.
Subactivity state
A subactivity state is represented in the same way as an action state, with the addition of an icon in the lower right corner depicting a nested activity diagram. On the subactivity, the name of the entered activity graph is shown. A subactivity state represents an activity graph. Entering a subactivity state represents entering the activity graph, which is nested in the subactivity state. The subactivity state is not exited until the final state of the nested graph is reached, or when trigger events occur on transitions coming out of the subactivity state. Since states in activity graphs do not normally have trigger events, subactivity states are normally exited when their nested graph is finished. A single activity graph can be invoked by many subactivity states. For more general information about working with symbols, see Chapter 4, "Diagrams Basics."
5-302
Define the selected subactivity state in the Subactivity State Specification dialog box.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name Box name 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
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
F l o w Fi n a l
It is a final node that terminates a flow. Destroys all tokens that arrive at it. It has no effect on other flows in the activity.
5-304
For more information defining pseudo states, see Section PseudoStates on page 5-286.
D e c i s i o n Po i n t
Decisions are made using guard conditions. They help protect transitions that depend on a guarding condition. The symbol used for the decision is a large diamond, which may have one or more incoming transitions and two or more outgoing transitions. A decision point in an activity diagram is used much like a dynamic choice or junction point in state diagrams. Decision points allows to separate and merge transition paths back together.
5-305
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.
5-306
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.
drop-down list box. The Assign State button is activated and you may create a classifier in state. 3 Click the Assign State button. Classifier in State Specification dialog box
5-307
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
shortcut menu. The Object Flow State Specification dialog box appears. 2 Choose a classifier you wish to assign to an object flow from the Type dropdown box.
NOTE
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.
shortcut menu. The Transition Specification dialog box of the incoming transition path appears.
5-308
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.
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
Also multidimentional swimlanes can be created (from the swimlane shortcut menu, choose the Insert Vertical Swimlane or Insert Horizontal Swimlane commands):
5-310
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.
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
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.
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
(K)
(O)
Node Execution Environment Element is used for indicating that node is execution environment.
Node Device A physical computational resource with processing capability upon which artifacts may be deployed for execution.
5-314
Notation
(T)
Node Instance Execution Environment Element is used for indicating that node is execution environment.
(P)
(F)
Class (C)
5-315
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
Notation
(B)
(I)
(SHIFT+O)
Association
(S)
(L)
5-316
Element Generalization
Notation
(G)
Realization
(E)
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
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.
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:
5-318
Artifacts
For more general information about working with symbols, see Chapter 4, "Diagrams Basics." Define the selected component in the Component Specification dialog box. Component Specification dialog box
5-319
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
5-320
Tab name
Function The Component Specification dialog box appears. Define the component. Remove the selected component.
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
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
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.
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.
5-322
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.
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.
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
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
5-324
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.
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.
open the Stereotypes tab. Choose a model element for which you would like to create a stereotype with an icon. -orIn the element Specification dialog box, Stereotypes tab, click the Edit button, the Edit Stereotypes dialog box appears. 2 Click the Add button. The Stereotypes Specification dialog box appears. 3 Click the Icon ... button and from the Open dialog box, select an image you want to place for a stereotype. Click the Open button. 4 Type the name of a stereotype and click OK in all opened dialog boxes.
5-325
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
From the Tools menu, choose Profiles. The Profiles dialog box appears. Select the desired profile and Stereotypes tab. Here you may define your own stereotypes and edit them. In the element Specification dialog box, Stereotypes tab, click the Edit button. Select the desired profile and Stereotypes tab.
5-326
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
Icon
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
5-328
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
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
5-330
Icon
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
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
5-332
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
Icon
5-333
Icon
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.
5-334
DIALOG BOX
In the Profiles dialog box, Tag Definitions tab, click the Add or Edit button.
Refere to the Section Specification dialog boxes on page 4-133 for the information of the specification elements not covered in this section.
Tab name 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
Tab name
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
In the Tag Definition Specification dialog box, Typed Values tab, click the Edit button. In the Tagged Values tab of the Specification dialog box, click the the Value button.
5-336
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.
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.
TAG DEFINITIONS
TAB
From the Tools menu, choose Profiles, then Tag Definitions tab, and then click Edit.
5-337
In the elements Specification dialog box, Tagged Values tab, click the Edit Tag Definitions button.
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.
5-338
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.
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.
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
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.
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.
5-340
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
Tab name Constrained Elements The list of elements subject to the constraint
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.
From the Tools menu, choose Profiles and then Constraints tab. Click the ... button in the elements Specification dialog box, Constraints tab.
5-342
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
5-344
5-345
5-346
5-347
5-348
5-349
5-350
5-351
5-352
5-353
5-354
5-355
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
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.
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.
6-358
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
6-360
Toolbar Button Content Shape Creates a table of contents of all diagrams of the project.
Notation
Package
Dependency A relationship showing that one diagram depends on the other. Class Diagram Creates a class diagram.
Collaboration Diagram Creates a collaboration diagram. Sequence Diagram Creates a sequence diagram.
6-361
Notation
Implementation Diagram Creates an implementation diagram. Time Diagram Creates a time diagram.
CORBA IDL Diagram Creates a CORBA IDL diagram. WSDL Diagram Creates a WSDL diagram.
6-362
Toolbar Button Robustness Diagram Creates a robustness diagram. DDL Diagram Creates a DDL diagram.
Notation
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
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)
6-364
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
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
Reference: Building Web Applications with UML by Jim Conallen Copyright 2000 by Addison Wesley Longman, Inc.
6-366
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
(SHIFT+C)
Form
(SHIFT+F)
Frame
(SHIFT+E)
Target
(SHIFT+T)
Class (C)
6-368
(I) Package (P) Subsystem (Y) Model (M) Realize (R) Realization (E) Dependency (D) Generalization (G) Association (S) Aggregation A Composition (F)
6-369
(B)
Link (L)
Submit (U)
6-370
(SHIFT+P)
Separator (W)
6-371
6-372
(I) CORBA IDL Value (V) Class by Pattern The Pattern Wizard appears. SHIFT+P Generalization (G) Truncatable Generalization
6-373
(C) Interface (I) Dependency (D) Binding Dependency (B) Containment (SHIFT+C) Separator W
D D L D IA G R A M
DDL diagram is used to draw database definition elements. DDL diagram simplifies creation of primary key, foreign key, triggers and etc. The detailed description about DDL usage in MagicDraw, see MagicDraw Code Engineering Users Guide, Chapter DDL Script Engineering.
6-374
6-375
(V) Relationship (R) Foreign Key (F) database (D) schema (S) Separator W
WSDL DIAGRAM
WSDL diagram is used to draw WSDL elements. Allows to create all elements used in wsdl file, except schema. Schema elements can be created using XMLSchema diagram. WSDL plugin has pattern for creating binding element. WSDL plugin requires XMLSchema plugin.
6-376
6-377
(T) WSDLbinding (B) WSDLport (SHIFT+P) WSDLservice (S) WSDLdefinitions (D) WSDLtypes (Y) WSDLimport (I) Xmlns (SHIFT+L) XDSnamespace (P) Realization (E) Separator (W)
6-378
6-379
6-380
(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
(A) Composition (F) Binding Dependency (B) XSDrestriction (R) XSDextension (E) XSDimport (M) XSDinclude (D) XSDredefine (SHIFT+F) xmlns (SHIFT+L) Separator W
T IM E D I A G R A M
6-382
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
Concurrent Lifeline (L) Message: synchronous uninterpreted (M) Message <<RTevent>>, <<CRimmediate>>
Message <<CRimmediate>>
Message <<SAtrigger>> ) Message to Self: synchronous uninterpreted (S) Recursive Message (R) Diagonal Message: synchronous uninterpreted (D) Separator W
6-384
TOOLS
MagicDraw provides the following tools and wizards to help you perform the design tasks in your job quickly and easily:
Reports prepares HTML, PDF, or RTF report documents describing the model. Class Diagram Wizard helps to create and customize new class diagrams. 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.
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.
7-386
TO O L S Reports
In XSL transformation, an XSLT processor reads XML document and XSLT style sheet. The processor outputs new XML document based on the instructions it finds in the XSLT style sheet. There is also special support for HTML output. In XSL formatting, XML data is formatted for output to screen, paper or other media. The figure below shows the report generation mechanism.
Since version 7.1, it is possible to generate reports from command line - Report Generator tool is presented. The description about Report Generator tool, see in Section Report Generator Tool on page 7-404.
Te m p l a t e M a n a g e m e n t t a b
The Report dialog box allows you to select from an array of predefined report templates (styles), or you can create your own report template. The information in the Template Management tab
7-387
TO O L S Reports
is organized into trees. You may edit, delete, import, export, create your own template, make one of the templates as the default one.
Model Report. Describes your UML model from different viewpoints, which are already predefined in MagicDraw or you may create your own. Predefined templates:
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.
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).
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.
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.
Report, Software Design Description report, or Model Extension Report. 2 In the right pane, select the template and click the Delete button.
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
TO O L S Reports
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.
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.
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.
Preformatted Documentation
Only for model report.
Show Introduction Section Includes Introduction section with Purpose, Scope and Overview subsections (if selected). Only for use case report,
software design description, and model extension report.
7-391
TO O L S Reports
Description Type the purpose of the generated document. This text will be included in the Purpose subsection. Includes Scope subsection in the Introduction section.
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.
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.
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
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
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
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.
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
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
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
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
TO O L S Reports
S e l e c t Pa c k a g e s t a b
From the Select Package tab, select one package from which you want the report will be generated. By default, the Data package is selected and all model elements are included in the report.
7-398
TO O L S Reports
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
TO O L S Reports
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.
7-400
TO O L S Reports
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.
Re p or t C u st o m i z a t i o n
There is possibility to customize MagicDraw reports by editing XSL files. The final report generation result is determined by the three parameters: report type (e.g. Model Report), report style (e.g. Default) and report output format (e.g. PDF). Each report type can have one ore more report styles, and each report style can have up to six report output formats (HTML browsable and printable, XSL Formatting Objects, PDF, PS and RTF).
7-401
TO O L S Reports
The concrete values of these three parameters (report type, style and output format) define the location of the "Main.xsl" file. MagicDraw takes the project file (XML) and appropriate "Main.xsl" file (XSLT) as input for report generation. The "Main.xsl" file location pattern is: <MD_install_dir>/data/report/report_types/<reportType>/xsl/<reportStyle>/<outpu tFormat>/Main.xsl, -where
<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
HTML Browsable HTML Printable XSL Formatting Objects XSL Formatting Objects XSL Formatting Objects
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
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.
7-402
TO O L S Reports
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
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
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.
7-404
REPORT_FILE
IMAGE_FORMAT REPORT_PROPERTIES
REPORT_TYPE
DIAGRAM_LIST
OUTPUT_FORMAT
Generated reports are placed in the same directory where MagicDraw UML is installed or you may choose other directory.
7-405
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.
7-406
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.
7-407
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.
7-408
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
Type the name for a newly created diagram in the Type Class Diagram name text box. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button. Buttons available in the Package Dependency Diagram Wizard, specify name and package window:
7-410
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
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.
Choose the Package Overview Diagram Wizard from the Diagrams menu, Diagram Wizards submenu.
7-412
Invoke the package shortcut menu, choose Tools and then Package Overview Diagram Wizard. From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. In the wizards list, select the Package Overview Diagram Wizard. Double click or in the Model Visualizer dialog box, click the Start button.
Type the name for a newly created diagram in the Type Class Diagram name text box. The Add diagrams into their own package option button -while creating new package overview diagrams, adds diagrams in the same package they are created. The Add all diagrams into selected package - while creating new package overview diagrams, add diagrams in the selected package. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button. Buttons available in the Package Overview Diagram Wizard, specify name and package window:
Next> proceeds to the next step - Select Packages. Cancel cancels the wizard.
7-413
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.
7-414
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
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:
7-416
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.
7-417
H i e r a r c h y D i a g r a m Wi z a r d
The Hierarchy Diagram Wizard collects largest hierarchies and allows to display every of them as separate diagram or all in one diagram.
From the Diagrams main menu, choose the Diagram Wizards command and then Hierarchy Diagram Wizard. From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. From the wizards list, select the Hierarchy Diagram Wizard. From the model element shortcut menu, choose Tools and then Hierarchy Diagram Wizard.
Type the name for a new diagram in the Type diagram name field. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button. Buttons available in the Hierarchy Diagram Wizard, specify name and package window:
7-418
Next> proceeds to the next step - Select Scope. Cancel cancels the wizard. Help displays MagicDraw Help
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
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.
7-420
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.
From the Diagrams main menu, choose the Diagram Wizards command and then Realization Diagram Wizard .
7-421
From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. From the wizards list, select the Realization Diagram Wizard. From the model element shortcut menu, choose Tools and then Realization Diagram Wizard.
Type the name for a new diagram in the Type diagram name field. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button. Buttons available in the Realization Diagram Wizard, specify name and package window:
Next> proceeds to the next step - Select Scope. Cancel cancels the wizard.
7-422
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
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.
7-424
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
Diagram Wizard.
Type the name for a new diagram in the Type diagram name text box. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button. Buttons available in the Content Diagram Wizard, type diagram name window:
Next> proceeds to the next step - Parent package. Cancel cancels the wizard.
7-426
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
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.
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).
7-428
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
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.
7-430
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
TO O L S Pattern Wizard
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.
7-432
TO O L S 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.
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
TO O L S Pattern Wizard
Category
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
Main
7-434
TO O L S Pattern Wizard
Category
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
TO O L S Pattern Wizard
Category
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.
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
7-436
TO O L S Pattern Wizard
Category
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
Array
Fixed
7-437
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
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.
Box All
Function Contains names of all attributes defined within the selected class.
7-438
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:
When one classifier inherits operations from the base classifier (Generalization relationship). When some classifier implements Interface (Realization relationship).
7-439
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.
7-440
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.
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
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.
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
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.
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
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.
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.
7-444
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
Default value is "both". Change to "forward" to have this mapping valid only forward or to "reverse" - for reverse only.
If you want to apply direction order for all dependencies, you may set value for defaultDirection tag in the Package Specification dialog box. This package has <<typeMap>> stereotype. At first direction tag is checked on <<map>> dependency, then if not found - defaultDirection tag on <<typeMap>> package and last default value is set. You may have several <<map>> relationships from one source or to one destination. In such case one of relationships must have "default" tag set. Dependencies from one source without (or with several) default tag (set) are invalid. Also dependencies to one destination with "reverse" or "both" direction order set must have one with default tag. Transitive mapping for the elements (eg. Type1 -> Type2 -> Type3) are not supported. You may also control mapping behavior of the type inheritance in source model. By default, derived subtypes are also mapped by parent rule (unless of course they have their own rules for mapping). If blockInheritedSourceTypes tagged value is set - derived types are not affected by this rule.
Here T1, T2, T5 are types in the source domain T2, T4 - types in destination domain. Now, having these two mappings (T1 ->T2 and T3 ->T4), the following is true: T1 and all the types, derived from it (like T5) are mapped to the T2 type, except T3 and any of the types, derived from it - these are mapped to the T4. Now consider that blockInheritedSourceTypes is set:
7-446
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
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.
From the destination package shortcut menu, choose Tools and then Update Transformed Model. The Model refresh options dialog box appears:
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 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
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.
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.
7-451
TO O L S Metrics
Packages, classes and diagrams are displayed in this dialog. Selecting any element, selects all elements recursively. Unselecting element, unselects elements recursively. Unselecting the child element, unselects all parent elements. E.g. if Data package was selected, all model is selected. Clearing checkbox next to Package View package will clears all checkboxes next to inner Package View elements and next to Data package. Other packages remain selected. METRICS WINDOW Metrics window is implemented as JIDE GUI window. It is placed at the bottom of application, like the Messages window.
7-452
TO O L S Metrics
GUI element 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
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.
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.
Here Metric1 .. MetricN the metric name abbreviation. Each metric name is hyperlinked with metric description. Metric description can be opened in a separate window after clicking on the hyperlink.
NOTE:
*.html format is suitable for viewing metrics. If you want to copy metrics table to other program, please use *.txt format.
7-454
TO O L S Metrics
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.
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.
From the Tools menu, choose Metrics and then Metrics Options
7-455
TO O L S Metrics
On the left side of dialog defined metrics suites are displayed. Metrics suites can be cloned, renamed, removed, exported and imported using buttons or shortcut menu. Predefined metrics sets cannot be renamed or removed. One the right side the suit properties are displayed:
Element 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.
7-456
TO O L S Metrics
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
TO O L S Metrics
Metrics properties
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
Class
Diagram
7-458
TO O L S Metrics
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:
7-459
TO O L S Metrics
7-460
TO O L S Metrics
7-461
TO O L S Metrics
7-462
INDEX
A
abstract class 185, 235 operation 197 Abstract (generalizable element) 140, 218 abstraction 227 action state 296, 299 defining arguments 301 defining entry action for 301 defining multiplicity 301 set as dynamic 301 actions 260 in state and activity diagrams 287 types of 263 activation bar 266, 271 active class 185 object 264 activity diagram 294 incompatibilities between Rose and MagicDraw 108 incompatibilities between Together and MagicDraw 113 actor 231 working with 233 addOnly 192 aggregation 180 creating 223 argument in action state 301 of action 264 of binding dependency 227 assigning classifier to classifier role 252 classifier to collaboration 215 classifier to instance 247 instance to collaboration 215 model element to a package 145 model elements to component 321 state to object flow state 308 Assignment (action type) 263 association 179 in class diagram 218 in implementation diagram 316
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
464
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
465
D
data creating several shapes of the same 127 Data package 44 data types 201 DDL diagram 374 decision point 298 deep history state 286 defining model elements 133 deleting all model elements 96 from the Browser 95 symbol or model element 129 dependency 226 abstraction 227 binding 227 in implementation diagram 317 permission 228 usage 229 deployment diagram 312 deployment view 176 design patterns 205 Destroy (action type) 263 destroying sequence object 271 diagram closing 122 creating 120 defining properties of 58 information table 125 opening 121 renaming 122 saving as image 49 diagrams activity 294 class 176 collaboration 242 content 359 CORBA IDL 371 DDL 374 implementation 312 model management 174 robustness 363 sequence 265 state 274 use case 230 web 365 WSDL 376 XML Schema 379, 382 display related elements 127
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
466
visibility of 164 grouping diagrams in Browser 91 generalization paths into tree 217 of model elements 208, 210 realizations into tree 226 guard expression 293 Guarded 198
H
history state 286 HTML text 150 hyperlink 150 for model element 150
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
467
diagonal 267 in collaboration diagram 245 asynchronous 255 balking 255 synchronous 255 time-out 255 in sequence diagram 272 asynchronous 272 balking 272 call 273 create 273 destroy 274 return 273 send 273 synchronous 272 terminate 274 time-out 273 uninterpreted 274 predecessor of 259 recursive 267 to self 267 uninterpreted 267 model 213 development of 12 static structural 176 model element defining 133 saving as image 49 model management 177 modules functionality 63 moving of all model elements 96 symbol 132 MS Office copying to 133 multiobject creating 247 multiple windows 42 multiplicity defining for classifier role 252 for dynamic action state 301 of an attribute 192 of association end 224
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
468
Data 44 dependency wizard 410, 412 showing assigned model elements 210 parameter of an operation 196 parameterized class 199 defining of 199 parent element 216 partition 309 partitioning 63 paste 132 with new data 132 path 120 changing style of 129 defining properties of 58 drawing 129 patterns See design patterns permission 228 predecessor 259 presentation options for class 206 primitive 205 printing 165 process view 176 programming language data type 205 project dividing into modules 63 multiple projects 83 opening of 50 packages of 44 reusing project parts 63 properties changing code generation 90 pseudostate 274, 286
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
469
drawing of 126 shortcut keys assigning 164 Signal (event type) 290 signal receipt 309 trigger event for 309 signal sending 298, 308 defining an action 308 smart manipulation 130 Solaris JVM 21 sorting of attributes 208 of operations 208 state 275, 278, 296 concurrent 282 internal 280 state diagram incompatibilities between Rose and MagicDraw 108 incompatibilities between Together and MagicDraw 113 model elements in 275 state machine 274 statechart diagram See state diagram stereotypes Builds 331 Client Page 328 creating of 325 defining properties of 58 Form 328 Frame Context 331 Frame Set 329 IIOP 333 importing 325 Input Element 333 JavaScript 329 Link 329 Object 333 Page 334 Redirect 331 RMI 333 Select Element 333 Server Page 327 show/hide on a symbol 144 showing on class 208 Submit 331 Target 329 Targeted Link 331 Text Area 334 working with 323 stimulus 254
asynchronous 255 balking 255 changing numbering 258 changing numbering of 258 defining action for 258 main information about 245 synchronous 255 time-out 255 stub state 277 subactivity state 302 submachine state 282 substate 280 subsystem adding operation to 212 description 210 realization elements 210 specification elements 210 support for MagicDraw 17 swimlane 309 symbols 120 defining properties 144 formatting 58 moving 132 presentation of constraint 150 note 169 note anchor 150 separator 150 text box 150 synch state 285 defining bound number 285 synchronization bar horizontal 277, 298 vertical 277, 298 synchronous 255 system boundary 231
T
tagged values show/hide on a symbol 144 showing on class 208 working with 334 template parameterized class See parameterized class saving as 48 Terminate (action type) 263 text box 150 adding hyperlink 150 text as HTML in 150 text editor choosing 90 Time (event type) 290
470
time-out 255 TODO 339 Together exporting model to XML 110 importing model 110 XMI model exchange 109 transition 291, 297 differences in state and activity diagrams 292 effect action for 293 guard expression for 293 to self 277 trigger event for 293 trigger event for a signal receipt 309 for a transition 293 type modifier 191 type of an attribute showing full path 207
X
XMI 47 exporting project to 106, 111 XML Schema diagram 379, 382
Z
zooming 162 adjusting step size 163 fit in window 162 to maximum size 163 to original size 163 using Browser 97 zoom in 163 zoom out 163
U
Uninterpreted (action type) 263 Unix installation 22 updating MagicDraw 22 usage 229 use case adding extension point 237 description of 235 extension point 235 use case diagram 230 incompatibilities between Rose and MagicDraw 107 incompatibilities between Together and MagicDraw 112 use case view 175
V
visibility for operation 198 of association end 224 showing on attribute 207 showing on operation 207
W
web diagram 365 web extension 327 Windows interface style 41 JVM 21 wizards 386 workspace 45
471