Book a Demo

Author Topic: Associating UML Elements across diagrams  (Read 5755 times)

PMP

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Associating UML Elements across diagrams
« on: September 23, 2005, 03:36:19 pm »
I want to be to do the following:

1. Link a State (from the State Chart) to the Class for which it applies.

2. Link an Action (from an Activity Diagram) to the State Transition it causes.

3. Link a Component (in the Component Diagram) to the Classes it encapsulates.

There doesn't appear to be a default/formal way to do this (happy to hear about it if I'm wrong).

So the alternative I'm looking at is to create Links for each of these cases, either using a custom Stereotype or one of the existing ones (with a note).

Embedding in some note field is not good because it's not visible on the diagram and I'd like to be able to report and transform based on reliable meta-data.

If anyone out there wants to share their thoughts/approaches on this I'd welcome them.

Much appreciated.

- Paul

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Associating UML Elements across diagrams
« Reply #1 on: September 23, 2005, 07:21:20 pm »
Quote
I want to be to do the following:

1. Link a State (from the State Chart) to the Class for which it applies.

2. Link an Action (from an Activity Diagram) to the State Transition it causes.

3. Link a Component (in the Component Diagram) to the Classes it encapsulates.

There doesn't appear to be a default/formal way to do this (happy to hear about it if I'm wrong).

So the alternative I'm looking at is to create Links for each of these cases, either using a custom Stereotype or one of the existing ones (with a note).

Embedding in some note field is not good because it's not visible on the diagram and I'd like to be able to report and transform based on reliable meta-data.

If anyone out there wants to share their thoughts/approaches on this I'd welcome them.

Much appreciated.

- Paul
Notes should be avoided, if at all possible.

One of EA's nicest features is the Feature Linked Note which just manifests the information in the Element.

Paul, you need firstly to decide what is the nature of the relationship between the two elements in each of your three cases.

FWIW:

One could argue that a State is Nested in the Class to which it applies.

Similarly an Action Realizes the StateTransition.

Lastly, UML sates that an Artifact «manifest» elements.   It also states that a Component is a Classifier (and therefore not an instance) [size=13]Classifiers vs Instances[/size] addresses this.  That is not to say there isn't a relationship between the Component and Classes, it's just, in my view, a derived one.  In my models, the relationship goes from Component to ComponentInstance to ArtifactInstance to Artifact to Class.

HTH,
Paolo

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

PMP

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Associating UML Elements across diagrams
« Reply #2 on: September 24, 2005, 09:41:11 am »
Hi Paolo, interesting responses. And they prompted me to do more research (and as you suggested) think about what I wanted to do.

What I want to do is develop rich UML models that are simple to transform into sophisticated (Java) code. Our Java design patterns map Event, State, Action and the Data Abstraction Object, into a "Business Component" -- this is a class that encapsulates data, process and rule.

So in order to achieve this I'm trying to make direct associations between behavioral and structural elements.

On the OMG site, when discussing UML 2.0 features, they say the following about Nested Classifiers:

"This is an extremely powerful concept. In UML, almost every model building block you work with (classes, objects, components, behaviors such as activities and state machines, and more) is a classifier. In UML 2.0, you can nest a set of classes inside the component that manages them, or embed a behavior (such as a state machine) inside the class or component that implements it. This capability also lets you build up complex behaviors from simpler ones, the capability that defines the Interaction Overview Diagram. "

And so I think that the Nested Classifier is the right way to go for what I'm trying to do.

Thanks!

- Paul

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Associating UML Elements across diagrams
« Reply #3 on: September 24, 2005, 04:37:46 pm »
Quote
Hi Paolo, interesting responses. And they prompted me to do more research (and as you suggested) think about what I wanted to do.
WARNING! According to Dijkstra, the more you think, the less you have to do!  8)
Quote
[size=13][SNIP][/size]
And so I think that the Nested Classifier is the right way to go for what I'm trying to do.
Hi Paul,
If nesting is one approach you intend to use, you might want to look at: [size=13]Collections, Containers, Composites & Nests[/size] for some thoughts on Nests.  It would be good for you to provide feedback on the new nesting link, in the light of your experiences - especially with the behavioural Classifiers.  So far I've concentrated on Structural ones as I'm trying to emit existing code - without yet refactoring.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!