HOWTO use UML2 Components as graphical and logical wrappers

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.

Ownership and the parasitic wrapper Component

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.


 

Physical ownership vs. logical grouping in MagicDraw UML

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:

  • If one moves any Element from a Package/Model to a Component in
    the browser
    the Component takes ownership.
  • If one moves a Classifier from anywhere on a diagram into
    (within the rectangular boundary of) a Component in a diagram,
    that Component does NOT take ownership of the Classifier, the original
    ownership is preserved. A Realization relationship is generated between the visually contained Classifier this is
    what enables me to create "Class collaborations", and "composition views" of Blocks,
    Classes, and Artifacts without disturbing ownership.
  • By contrast, if one moves a Comment on a diagam into (within the
    rectangular boundary of) a Component in a diagram,
    the Component takes ("steals") ownership.

Concise view of wrapper Component, no ownership or Realizations shown

Usually one does not show the Realizations between visually contained elements and a "wrapper" Component.

Elements related to the wrapper_ Magicdraw UML 15.0

One can leverage the Realization relationships between visually contained elements and a wrapper Component for tracing logical groupings.

Advanced example: conformance analysis of SysML specification for Rate stereotype vs. MD SysML Plugin

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:

  1. for most text parsed from the <<SysML1.0>> spec simple stereotyped Comment elements are used
  2. for some text parsed from the <<SysML1.0>> spec stereotyped Artifact elements are used, so that dependencies to other elements can be established (which can then be shown again easily on other diagrams using Display Related Elements)
  3. all Comments and Artifacts are very carefully packaged (owned) to reflect the specification chapters
  4. the wrapper Component technique is used to package elements of the parsed context (in this case 11.3.2.8 Rate)
    1. there are many cross references to other wrapper Components, which carry hyperlinks to their focus diagrams
    2. the wrapper Components are mostly styled faint so that they do not distract from the wrapped elements
  5. there are many navigation paths to other points in the model using diagram icons

On using singleton wrapper Components to provide documentation and navigation points for read-only classes

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:

  1. one can't add hyperlinks to read-only elements
  2. one can provide a different packaging context - such as relationship to chapters of a technical document that refers to wrapped read-only Class.
  3. one can provide a container for documentation and parsed text related to the read-only element

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:

  • the <<Discrete>> stereotype is in the read-only SysML Profile.Activities)
  • the 11.3.2.3 Discrete Component is the "conformance wrapper" for the stereotype:
    • it carries a hyperlink to a diagram about  the "concept" 11.3.2.3 Discrete as described in the spec (as opposed to the implementation in MD SysML
    • it has a parastic Realizes relationship to SysML Profile.Activities.Discrete (see next images)

This is repeated for each and every stereotype in the specification, which is the basis of the conformance process using UML Parsing Analysis.

Example: a singleton wrapper Component "opened up" into the "focus" diagram for its wrapped Class

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)