2

I am currently trying to understand the practical difference between diagrams and models, in the context of UML and BPMN, and came accross this statement:

"A UML model contains a lot of information, that are not necessarily shown in a diagram."

And I dont understand, what information is part of a model that is missing in a diagram?

coffee-and-code
  • 205
  • 2
  • 12
  • 1
    All parts can be missing. I could have a perfectly valid model without a single diagram. – Geert Bellekens Apr 14 '22 at 08:30
  • @GeertBellekens So if we have a model with a single diagram, the information in both is 100% the same? Or does the model contain some additional information that cannot be visually represented? – coffee-and-code Apr 14 '22 at 08:35
  • 1
    A diagram is a partial view of a model. A lot of information that is in the model can be left out of the diagram. – Geert Bellekens Apr 14 '22 at 08:43

4 Answers4

4

The model can exist without any diagram. Of course, it would be much more cumbersome to edit the model by only using textbased dialogs, so most modelers will probably start with a diagram.

The content of the model can be shown in as many diagrams as you like and you can select what part of the information in the model you want to show. If a class has 10 attributes, you can choose to show only three. It is very good practice to only show the attributes relevant for the envisioned readers of the diagram.

There are also properties that don't have a notation, like the method defined for an operation or many derived properties. If you want to find out, whether a method has been assigned to an operation, you have to look in the model. Or if you want to find all the ownedElements of an element.

Axel Scheithauer
  • 2,758
  • 5
  • 13
  • 1
    Suppose we have a model without any diagram. Could this be a UML model or a BPMN model in your view? – www.admiraalit.nl Apr 14 '22 at 10:08
  • 1
    @www.admiraalit.nl without any doubt. I can have a [bpmn model described in bpel](https://stackoverflow.com/a/37424518/3723423), ready for execution. Or I could write a model in [XMI](https://en.m.wikipedia.org/wiki/XML_Metadata_Interchange) to use it in automated tools, or using XSLT to generate textual documentation. :-) – Christophe Apr 14 '22 at 18:31
2

In a nutshell: diagrams are made from models in order to show them to humans (even not fluent in understanding UML).

P.S. Also see p. 681 of UML 2.5:

A UML model consists of elements such as packages, classes, and associations. The corresponding UML diagrams are graphical representations of parts of the UML model.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • 2
    Usually, a model is created by making diagrams, so I would say 'models a made from diagrams' instead of vice versa. – www.admiraalit.nl Apr 14 '22 at 12:22
  • @www.admiraalit.nl sorry for being provocative, nothing personal, but I could start with a textual model (“model as code”) e.g. a plantuml script and maintain it, and only later generate the diagram that interests me (or use xmi and xslt for more ambitious models with several diagrams). But I agree with you, often the relation is bidirectional – Christophe Apr 14 '22 at 18:38
  • 1
    @www.admiraalit.nl Well, hen and egg. Yes, you design (as a human) using the diagram. But that will be the seed for the model. The kernel however is always the model. – qwerty_so Apr 14 '22 at 19:36
1

There are plenty of intersting answers here. But I’d like to contribute as well:

  • a model is a simplified representation of some sort of (present or future) “reality”, such as a system for an UML model, or business processes for BPMN. The purpose is to better understand this “reality” and being able to reason on it (analysis, design) before implementing it or changing it.
  • a diagram is a graphical representation of a part of a model.

So the model can be represented with many different diagrams that each show and focus on different aspects of the “reality”. Conversely, the model may aggregate many different aspects and relate them together (e.g an UML signal has a structure with attributes, can be sent or received by classes, can be exchanged as messages between objects, etc.) independently of any specific diagram.

This is not specific to UML or BPMN. Take for example a house. You'll discuss with an architect about a lot of things. In the head of the architect, a model will start to emerge. And the architect will draw many diagrams to represent this model and discuss it with you with a visual support: the front and side views let you imagine how it’ll look like; a view from above lets you understand how the house will be placed on the ground; some first sketches will enable arrangement of the rooms; a blueprint of a floor will provide all the detailed measures for the construction; some electrical schemas will tell how the wires are connected; etc.

Christophe
  • 68,716
  • 7
  • 72
  • 138
0

UML defines a model as follows:

A model is always a model of something. The thing being modeled can generically be considered a system within some domain of discourse. The model then makes some statements of interest about that system, abstracting from all the details of the system that could possibly be described, from a certain point of view and for a certain purpose.

A model is an abstract notion, which can be represented by concrete notations, like diagrams, human-readable text or machine-readable files. The main representation defined by UML and BPMN is by means of diagrams, but the UML and BPMN specifications also define how to serialize a model in XML format.

One model may be represented by multiple diagrams. Each diagram represents a part of the model.

For example, a UML model of a relational database may be represented by multiple diagrams, where some tables are shown on one diagram and other tables are shown on another diagram. All the information contained in all these diagrams together form the model of the database.

There may be information about the model captured in a non-diagram format. If there is a mapping of this format to the UML/BPMN metamodel, one may consider that to be a representation of a (part of a) UML/BPMN model as well. However, for non-diagram formats the UML/BPMN standards refer to other standards like XMI.

Aside: In UML, there is a model element called Model. Such a Model is defined as a view on a physical system. In other words, you could make a UML model containing multiple Models, to indicate that you have multiple views of the same system. But this is not relevant for your question.

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
  • 2
    The UML defines an _abstract syntax_, the metamodel. It then defines the _semantics_ of an instance of the abstract syntax. This description doesn‘t depend on the representation of the abstract syntax. There is a normative xml-based representation of it (in the case of BPMN even two). The _notation_ is defined in the last section as an incomplete view of the model, however it may be specified. Aside: The _model_ element «model» is not the „model“, that is the subject of this discussion. – Axel Scheithauer Apr 14 '22 at 11:18
  • @AxelScheithauer, The xml-based representations are not part of the UML/BPMN standard. Do you think parts of my answer are incorrect or misleading? If so, which part(s)? – www.admiraalit.nl Apr 14 '22 at 11:39
  • I never came across _A model is always a model of something._ but that somehow makes me speechless. – qwerty_so Apr 14 '22 at 19:39
  • The UML does surely NOT define a model as being a set of diagrams. UML has a metamodel that defines the model. Please see p. 681 of UML 2.5: _A UML model consists of elements such as packages, classes, and associations. The corresponding UML diagrams are graphical representations of parts of the UML model._ – qwerty_so Apr 14 '22 at 19:43
  • 1
    @qwerty_so, Yes, I agree. I didn't write that a model is a set of diagrams. My point is, that a model cannot exist without it being represented by something. And the only representation defined by UML/BPMN is by means of diagrams. – www.admiraalit.nl Apr 15 '22 at 07:49
  • I wrote: "A model (...) can be represented by concrete notations, like diagrams, human-readable text or machine-readable files." Is there any sentence in my answer that is not correct? – www.admiraalit.nl Apr 15 '22 at 07:56
  • I do agree with that. But you point out that bold sentence and in that form I do not agree. Sometimes I also can not express my thoughts well enough. In that case I simply withdraw it for better answers. Except where I'm stubborn ;-) – qwerty_so Apr 15 '22 at 09:15
  • @qwerty_so , You don't agree with the sentence in bold. This implies that you think UML or BPMN defines a model representation other than a graphical one. Could you give an example of such a representation, part of either the UML- or the BPMN-specification? – www.admiraalit.nl Apr 15 '22 at 09:29
  • Diagrams as defined in UML *can* not visualize everything that is defined in the metamodel. A textual notation may also be incomplete. Both are just views or, if you like, representations of the model. While tools are free to not use the metamodel internally, they are obliged to act as if they do. Both specifications list on their cover page normative xml representations of the metamodel and define how to serialize a model in the same way. That shows that they define a representation of the model independent of diagrams. – Axel Scheithauer Apr 15 '22 at 09:36
  • @AxelScheithauer, Thanks, you're right, I didn't know that they define XML serialization. I have changed my statement that diagrams are the only representation defined by the standards. Still, I think the graphical notation is the main purpose of their existance. – www.admiraalit.nl Apr 15 '22 at 11:41
  • That's what I meant with my stubbornness ;-) Anyhow, I now think it's ok this way. – qwerty_so Apr 15 '22 at 13:48
  • I agree that the main purpose of UML and BPMN is to define a graphical language. It would be half as useful, without an independent model. By the way, this was the reason to rename „modeling notation“ to „model and notation“ in BPMN 2 – Axel Scheithauer Apr 15 '22 at 14:06