So Grasshopper, you come to learn the great secrets
of the powerful MagicDraw UMLTM tool and plugins !
Dr Darren takes you through some of the tried and tested "tips and tricks" for power modelling in the MagicDraw UMLTM tool. The UMLTM mountain is high and hard to climb; there are many ways up the mountain, some are most treacherous, some are very rewarding, and sometimes the best way up depends on the weather. Let your joyful journey to UML mastery begin ! We are always both students and teachers of UML.
Visit also:
Please find here Dr Darren's style guidelines. I have found the style tips and recommendations here work on a wide range of problems. Style is a personal matter, and if you have other style preferences please do use them.
I recommend that you switch of the "show grid" option yet leave the grid placement behavior on, unless you really do want to exploit the grid feature for precise "geometrical" engineering diagramming.
The more I work with UML and SysML the more convinced I am of this, even if it is a contentious view.
And you will find that throughout this eSchool I apply this principle more often than not.
PROS of using black pen and no fill include:
In particular, I recommend that you do not work with the default MagicDraw UML colour styles for serious engineering, even though many customers are used to them:
Again, these are my opinions, not those of No Magic or the MagicDraw developers, so please do use whatever works for you.
In this example coloured pen styles are used to collect themes in a very complicated diagram.
In this example of a conformance analysis of the SysML1.0 spec's Rate stereotype against the MD SysML 15 Plugin I have used:
Please note:
Please also always be mindful that not all people can see all colours well.
PROS of using the Comment:
CONS of the Comment:
Visit also:
I recommend Java-style field names for all property, port, and instance names.
For example:
animal: Animal
in: Port
It is important to show the date and author and modification time of all of your diagrams, unless you have special reasons not to, like publishing conditions.
TIP: if the diagram info box and the diagram frame title clash then place the diagram info AT THE BOTTOM. This has the advantage in large diagrams that the diagram name be read easily in two places, and does not distract readers as much.
In MagicDraw UML the UML2 Component element and its rectangular symbol can be used (misappropriated well) to graphically and logically group other UML elements without "stealing ownership". This advanced strategy can greatly aid power diagramming, model organisation, and logical decomposition of complex systems.
Here we show how elements owned by another element (such as a Model or a Package) can be visually contained within and logically grouped using "wrapper" Components.
NB: this powerful technique does NOT leverage the semantics of the UML2 Component, it exploits merely mechanical features of the Component element and its rectangular symbol. Hopefully in the future UML will provide a semantically neutral element for this purpose. The technique is also specifically tuned to the MagicDraw UML tool.
in MagicDraw UML and MD SysML it is possible to have an element
contained in one Package / Model in the browser (in the actual model),
yet visually contained within the boundary of the rectangle of
a number of Components in any number of diagrams:
Usually one does not show the Realizations between visually contained elements and a "wrapper" Component.
One can leverage the Realization relationships between visually contained elements and a wrapper Component for tracing logical groupings.
WARNING: This is deliberately a very advanced example with many cross references, dependencies, and associations.
Your own diagrams should be much simpler, please do divide-and-conquer into many smaller diagrams.
Please note the following aspects:
It is often useful to parasitically wrap Class elements (like the read-only metaclasses of the UML and SysML profiles for Magicdraw).
Some reasons include:
Example: Analysis of SysML1.0 Figure 11.8 - Abstract Syntax for SysML Activity Extensions in MD SysML 15
I use a wrapper Component 11.3.2.3 Discrete to contain information about the SysML stereotype Discrete:
This is repeated for each and every stereotype in the specification, which is the basis of the conformance process using UML Parsing Analysis.
If one clicks on the 11.3.2.3.Discrete conformance wrapper Component it opens up into a conformance analysis diagram.
The conformance wrapper graphically contains things determined to be directly related to the specification of the element. It DOES NOT however steal ownership of elements from outside, like the read-only metaclass (see the owner of each element). This is the feature of MD UML that makes wrapper Components possible.
TIP: provide some alternative navigation paths out of diagram using diagram icons and/or the parent wrapper (which is hyperlinked to a diagram)
Please visit also the many examples of "wrapper" Components elsewhere on this site such as:
The following example is from MD SysML Plugin and uses a Block with multiple Internal Block Diagrams (IBDs), however the same principle works for Composite Structure Diagrams in MD SysML.
The "active" hyperlink is the one that is used when you click on a symbol, however you can have more than one hyperlink.
By default a structured block (see the diagram menubar) in MD SysML gets a "focus" IBD of the same name and the name of it is synched to the block name: it is also set by default as the active hyperlink. (On MD UML a structured class gets a "focus" Composite Structure Diagram.) So when you first create a structured block just clicking on it will open up its "focus" IBD.
You can also assign and get to any of the other diagrams easily, too. Simple drag any number of diagram icons onto your block ! (The last one dragged will become active, so if you want your original focus diagram as active again, drag it on again.)
This has already been done for the example below. The aim is to have separate IBDs dedicated to electrical, mechanical, and optical systems, each one representing a different view of parts of the same block. (When doing this it is a good idea to use a lower case diagram name, so that they are not named like "focus" diagrams that correspond to Blocks.)
Now follow the trail to the next diagram to see how to choose to GoTo a given target diagram.
Make sure you only click once on the symbol (otherwise you'll already go to the currently active hyperlink target).
The image shows a Symbol with multiple hyperlink targets showing.
Note also the Usage in Diagrams sub-menu; please explore this alternative way to navigate.
When you click on the little hyperlink icon bottom left of a symbol you can choose between:
The Usage in Diagrams option is particularly good for navigating to SysML BDDs (UML2 class diagrams) of (possibly unknown and unanticipated) "assembly" blocks that use a given Block (or Class):
One can navigate to this diagram from the Block's symbol using the GoTo Usage in Diagrams feature.
Just for completeness, the full set of IBDs for the Block are given.
Shows all parts of the system (only stub parts are shown, they are placeholders for parts of different layers).
Would show all parts of the electrical layer, only one shown.
Would show all parts of the mechanical layer, only one shown.
Would show all parts of the optical layer, only one is given.
MagicDraw UML employs at least three types of model validation:
Please visit also:
This tutorial trail presents some of the basic steps for managing port-based service oriented systems in MagicDraw UML using the provided/required Interface mechanism of UML2.
I recommend that you have a class or implementation "focus" diagram for each port-based class and define/declare and document its ports and required and provided services there, BEFORE connecting it up in any particular usage context.
To create an InterfaceRealization from a typed Port to "provide" an Interface you can use:
To create a Usage from a typed Port to "require" an Interface you can similarly use:
Note that the PORT MUST BE TYPED already, otherwise it makes no sense for it to realise or use anything, because it is in fact the TYPE that realises or uses the interface.
That Type (a BehavioredClassifier) of the Port will then be seen to realise (provide) and use (require) the same interfaces (see next images).
Once ports are defined they may also be display as a lists in a compartment (rather than always showing the square-box notation which can be fiddly and leads to clutter, and is only really necessary for classifier-level "dependency wiring" in class-level diagrams or instance-level connections in structure diagrams).
In a Class simply disable the display option Suppress Ports.
In a Component you may additionally disable the display option Supress Interfaces to show the services provided and realised by the Component
Interfaces are in fact provided or required by Ports via the BehavioredClassifiers that type them (for most intents a purposes you may just think of the "Class" that types the Port). Here display related elements and/or display paths under the related elements menu has been used to show the Interfaces required and provided by the Classes used as types of the Ports of Class HasPorts in the previous example.
It is a good idea in MagicDraw UML to plan your connections "architecturally" first using Classifier-level Dependency wiring, which shows what may be validly connected, as opposed to what is connected in a particular context. This enables one to provide and require all necessary Interfaces before attempting to build a specific higher-order system. This process is supported in MagicDraw UMl; by the Display Paths and Display Related Elements features.
In the Composite Structure Diagram for a specific usage context use drag n' drop to build your system out of part Properties (which may or may not have Ports). Each part Property is a specification of one or more instances that may be created whenever an instance of the parent context is created. Use Display Provided Interfaces and Display Required Interfaces to display the interfaces required and provided by each port as "lollipop and fork" notation. This gives information (only) about the services required and provided via ports.
Optionally, the "conjugated" service provided and required via a particular Connector may indicated by dragging the provided Interface onto the Connector to make that Interface the 'conveyed' Classifier of an InformationFlow (notational only). This can help visualise what services are connected (as opposed to which services may be validly connected).
After you have created a composite structure (by using convenient drag n' drop to create part Properties) you may go back to the matching "architectural" class diagram used for planning the connections and generate composition associations (if you wish) by dragging the part Properties out of the context Class (i.e. they become "roles", Property ends of composing Associations from the context Class).
TIP: I recommend that you avoid trying to "compose" complex systems using associations; prefer the structure diagram "systems-engineering" approach wherever possible ! Note also that you can't show connections in a purely classifier-level diagram, so the associative composition diagram only shows only a subset of the structural information anyway.
Visit also:
MagicDraw UML offers a wide range of diagram export formats via the menu File>Save as Image.
The W3C's Scalable Vector Graphics (SVG) format is supported, however for online presentation this may exclude some of your audience. From http://en.wikipedia.org/wiki/Scalable_Vector_Graphics:
Support for SVG in web browsers
The use of SVG on the web is in its infancy; there is a great deal
of inertia due to the long-time use of pure raster formats and other
formats like Adobe Flash or Java applets, and browser support for SVG is still uneven. Web sites which serve SVG images, for example Wikipedia, typically also provide the images in a raster format, either automatically by HTTP content negotiation or allowing the user to directly choose the file.
This is also why this eSchool also serves most images as JPEG or PNG.
We compare here file sizes and behavior under scaling of an exported test diagram in MagicDraw UML.
Visit also:
As scaled by factor 3:
As scaled by a factor 3:
Scaled by factor 3:

FAILS to load in Drupal
FAILS to load in Drupal CMS.
Examples of good ways to use sterotyped comments to refactor and annotate your UML projects.
See also:
In this interesting and novel tutorial trail you will learn how to translate technical texts into UML models, using Dr Darren's innovative UML Parsing Analysis recipe - adapted to MagicDraw UML. This very powerful and effective technique can be combined with all of your requirements analysis, systems analysis, software engineering and systems engineering work, as well as with analysis and modelling of other technical, scientific, and even artistic topics.
The UML Parsing Analysis leverages two main techniques explored in related tutorial trails that you should study first:
There is a limitation to the degree and flexibility of binding afforded by handles from UML Comments drawn to model elements, since Comment handles are not true relationships, they do not appear in the UML model (repository) proper, and they are not easily traced. We will therefore also be exploring how to parse text into (misappopriated and stereotyped) Components (and optionally Artifacts) as "relatable parsing containers", and how to use Dependencies for very powerful and flexible UML Parsing Analysis. The widely practised, age-old technique of just copying technical text into Comments and relating them loosely with handles does not meet the requirements for the UML Parsing Analysis recipe; only the "happily misappropriated" stereotyped Component meets Dr Darren's conditions, and it is a truly powerful relatable parsing container.
Plenty of examples are available both within this eSchool and other sites: please do complete this tutorial trail here before visiting these resources (and then do please come back) !
Text sources that can be parsed into Comments bound to your UML model elements include:
It is often handy to be able to parse text into a relatable UML Elements (rather than into a Comment with just "handles") so that one can leverage Dependencies and the Display Related Elements facility of MagicDraw UML. Although a DirectedRelationship can be made between base Elements, the UML Parsing Analysis recipe employs (at least) the Dependency as the relationship, and (at least) a NamedElement. as a "parsing container" to hold the parsed analysis text.
There a number of candidate Classifiers that are suitable as relatable parsing containers, including:
DO NOT use Package (or Model) as a parsing container, as it steals ownership of elements, and thus is ill-suited to forming logical views !
I recommend that you parse text into Comment first then only "upgrade" to a Classifier if really necessary. Reasons for upgrading include:
A very good candidate for a relatable parsing container is the Component (a Classifier): In the "self-referential spirit" of UML Parsing Analysis the example below is a UML Parsing Analysis of one of the pages from this tutorial trail.
Despite these subtleties, if you really want the most powerful tecnical analysis modelling results, this is a very, very powerful strategy !
In the following image we see a parsing ot the familiar UML2.1.2 specification text for 7.3.14 Element (from Kernel) into stereotyped Components as relatable parsing containers. For comparison, the process is repeated for selected text snippets with Comments.
Note the use of tagged values with enumeration literals to describe clearly the source and "coordinates" of the parsed text (in this case from the UML2.1.2 spec) in the parsing containers. In general, try to get as much text out of the parsing container's name, and into the model in this way.
Here the elements related to a parsing container Component for the UML2.1.2 stereotype 7.3.14 Element (from Kernel) have been generated using the context menu:
Related Elements -> Display Related Elements
Then the remaining dependencies between other elements were generated using:
Related Elements -> Display Related Elements
(The diagram layout was then massaged a bit after using "Layout Organic Style".)
Note that:
Using Components as relatable parsing containers offers these particular features (as well as the ability of its symbol to graphically contain elements that its text refers to). This is the key to understanding the whole UML Parsing Analysis recipe !
The following shows an example of text from the specification of the UML2.1.2 7.3.45 Realization (from Dependencies) parsed into relatable parsing container Components, including an illustration of the notations and conventions referred to in the specification. This is a very powerful recipe, and it simply can't be done as well by only parsing technical text into Comments (which may only "relate" to elements through handles - which can't be traced - and can't graphically contain logical views):
Another candidate (besides a happily-misappropriated Component) for a relatable parsing container is the Artifact (a Classifier):
Despite these subtleties, if you want powerful text analysis modelling results, this is one good strategy
In this example I have parsed some of the SysML1.0 spec text for conformance analysis vs. MD SysML.
The original SysML1.0 specification text to be analysed was:
'11.3.2.4 NoBuffer
Description
When the «nobuffer» stereotype is applied to object nodes, tokens arriving at the node are discarded if they are refused by outgoing edges, or refused by actions for object nodes that are input pins. This is typically used with fast or continuously flowing data values, to prevent buffer overrun, or to model transient values, such as electrical signals. For object nodes that are the target of continuous flows, «nobuffer» and «overwrite» have the same effect. The stereotype does not override UML token offering semantics; it just indicates what happens to the token when it is accepted. When the stereotype is not applied, the semantics are as in UML, specifically, tokens arriving at an object node that are refused by outgoing edges, or action for inpu pins, are held until they can leave the object node.
Constraints
[1] The «nobuffer» and «overwrite» stereotypes cannot be applied to the same element at the same time.'
Most of the text has been parsed into UML Comments and handles are used to relate the text to UML elements.
I have chosen to "upgrade" at least two of the parsed spec text sentences from Comment parsing container to Artifact parsing containers:
The result is shown in the image below.
Here the elements related to a parsing wrapper for the SysML1.0 stereotype 11.3.2.4 NoBuffer have been generated using the context menu:
Related Elements -> Display Related Elements
Note that:
Although a bit more fuss than parsing text into Comments, parsing into Artifacts (or even into Components) brings with it this particular advantage.
Examples of the UML Parsing Analysis recipe using MagicDraw UML available online include:
Within this eSchool:
At other sites: