0

up until now, I always ignored the UML Metamodel, but now that I've taken a closer look at it, I have a question which isn't answered by the standard books which I have at hand.

The Metamodel describes elements and their associations per diagram. So, it defines for instance what kind of relationship an actor can have with a use case in a use case diagram.

But does it also describe the relationships / associations between diagrams? Or maybe better expressed between elements of different diagrams?

Example:

  • In a class diagram, I define how I structure my code. This is defined by the metamodel
  • In a deployment diagram, I specify how I deploy artifacts to execution nodes. Also defined by the metamodel
  • But does the metamodel also define relationships with which I can specify how I derive the artifact (which I deploy, maybe a .jar file) from my code?
rdmueller
  • 10,742
  • 10
  • 69
  • 126

2 Answers2

2

Diagrams are only a view onto the model. So you can show any arbitrary part of your model. Preferably you create a number of different structural diagrams to explain your model structure. Those are later augmented with behavioral diagrams which show how certain elements collaborate.

tl;dr UML is not about diagramming.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • Yes, Diagrams are a view into the model, but are these views connected through the model? Does the metamodel define these connections between the views? – rdmueller Feb 09 '18 at 15:21
  • A diagram does not constrain a model in any way. You can remove all diagrams and the model is still the same. A diagram is only a window to look through to help humans understand the model. The only semantics it has is to be a visual representation. – qwerty_so Feb 09 '18 at 16:06
  • hm. I see. It is hard for me to express myself. Let's put it this way: I have the feeling that the metamodel defines islands - groups of elements which are not connected to other elements. See my example - is the artifact element somehow connected to the class element? I know that you can connect them, but does the metamodell define a meaningful connection? – rdmueller Feb 09 '18 at 17:06
  • You would use weak connectors (e.g. Dependency, eventually adorned with a `<>` stereotype) for such things. The metamodel covers these. There are not so many constraints for those weak connectors. – qwerty_so Feb 09 '18 at 19:17
1

Yes, metamodel explains how various elements of a model can be connected. Diagrams itself represent poets puff the model and it is also described in a metamodel. While it's not always clearly shown how to actually represent that, for example each behavioral model represent behavior of something. What can have this type of behaviour is part of metamodel.

Let's look at specific example. Consider State Machine. Metamodel defines which elements can have State Machines (e.g. A class). So if you have a certain class you can draw a diagram of State Machine owned by this class. How to show that this SM is owned by that class is a different story but that is also possible with UML. Then on a state machine you can have activities which according to metamodel have to be owned by the same class etc.

One remark - it's spread over the whole specification. But look at definitions of elements like classifier, behaviour, state machine etc. That's where your answer is.

Ister
  • 5,958
  • 17
  • 26