📜 ⬆️ ⬇️

Understanding paradigms for building domain models

Introduction


Maybe someone will ask a question, and where is the mathematics? I will answer right away: everything that is stated here refers directly to mathematics.
Studying the literature on the theory of building domain models, I found a serious gap. The authors of articles and books immediately take one of the modeling notations: ER-diagrams, or class diagrams, and at a fast pace begin to use them to describe the subject area. At the same time, the description of the paradigm in which this simulation is carried out is not disclosed at all. And consequently, the limitations of one or another notation remain not disclosed. Alas, we all know how to build models, but few know how to explain what he built in one of the existing paradigms. Therefore, I often hear wild terms from the point of view of any paradigm: class of types, types of classes, types of types, and so on, but I have never heard the correct term “class of classes”. This gap in our education is very serious. And I will explain why.

Let's ask analysts a simple question.

Those who modeled the processes are probably familiar with the BPMN notation. Very often, when simulating an operation to conclude a contract, I encounter such a fragment of the diagram:
')


It can be seen that as a result of the conclusion of the contract, something is born that is transferred to another operation. But what does the element of the chart in the form of a sheet with a folded corner mean? We need to know exactly what is transferred from one operation to another, otherwise it will be difficult to explain to others what is required of them. So, what is created at the exit of the operation "Conclude an Agreement"?
The answers I heard are as follows:


While I observe a lack of agreement between analysts on the subject of what is being transmitted, and what the terms “contract”, “flow”, “agreement”, “information”, “data” mean. To answer this question, I had to dig deep and in the direction of paradigms. Moreover, the answer required splitting the question into two. The first question was: “How to correctly formulate the question?” And the second was: “How to answer it?”. For proper formulation it was necessary to choose the appropriate paradigm. This article is devoted to a story about two paradigms: Aristotelian and logical, and why I chose the logical as the working one. I will not give an answer to the question posed in this article. I will give the answer in another article.


How do we build a model of existence?




Look at the drawing. It schematically depicts the process of constructing a model of being.



Thus, we see that the paradigm, model and notation is that which is in the mind of the subject. We see that the existence, the description of the paradigm, the description of the notation, and the representation of the model are those that are outside the subject.

If we make the ADMISSION that the world REALLY consists of 4-D space-time and objects located in it, then the picture can be redrawn like this:



Paradigm features


To describe the world, we usually use two paradigms: the paradigm of Aristotle and the logical paradigm. Both of them rest on the assumption that the world is objective and is a 4-D space-time. But there are differences between paradigms that I have to emphasize.



Well, when the paradigm and notation are consistent. Then the paradigm capabilities will be fully exploited. And then “thinking with the help of records” becomes possible. That is, it will be possible to draw a model view simultaneously with its creation. Many think so when, for example, they write articles, draw pictures, or draw drawings.

The paradigm of Aristotle is consistent with the simulation in the form of tables. However, the connection between the tables is something that Aristotle did not plan. Therefore, the ER-diagram notation, although based on the paradigm of Aristotle, goes beyond its borders. The notation class diagram also goes beyond the limits of Aristotle’s paradigm and is inconsistent with it. It is used to simulate software code. In the objective world, you will find neither inheritance nor encapsulation. All of these programming terms, not the subject area. For describing the subject area, class diagrams and ER diagrams are suitable, as Levenchuk said in one of his articles , between bad and very bad. Many do not know these restrictions, and therefore they believe that there are no restrictions at all. This misconception is treated in only one way - the study of the logical paradigm. For the logical paradigm, two notations are used, described in ISO 15926.

There is a dispute between engineers and philosophers. Engineers often reproach philosophers for saying that they are engaged in verbiage. Philosophers say that if it were not for their verbiage, there would be no engineers. And the mathematicians are silent. But the trick is that mathematics and philosophy were merged together before the 20th century. Descartes and Cantor are the great philosophers of mathematics. The task was simple. It was not enough to come up with a paradigm, it was necessary to come up with a notation for the transfer of models in this paradigm to other citizens, and also it was necessary to be able to check the paradigm for consistency. The solution of this problem involved a mercenary of philosophy - mathematics. But in the 20th century, Russell suggested that mathematics should be separated from philosophy. Just because mathematics gave results too far from our empirical experience. And instead of postulating the limitations of our experience, Russell acted in the spirit of anthropocentrism — he suggested that we no longer think about the meaning of mathematical discoveries. Well done! We are reaping the benefits of this division now. Now there are few who know the paradigms and why they exist. Many notations, divorced from paradigms, are produced, the task of which is to satisfy the needs here and now. And the fact that they are contradictory and the boundaries of their capabilities are not described is of very few people who care. It is a pity, because as a result of notation, it is massively used to build domain models by people who do not know the limitations of these notations. However, not everything is so bad. There are those who know it. The book on page 36-37 says:
Software objects in a sense correspond to real-world objects, but are not their exact models or copies. Although the resulting design class diagram does not fully match the domain model, some class names and their characteristics are the same. Object-oriented design solutions and languages ​​allow to reduce the gap between the presentation of information in the form of software components and mental domain models. This improves presentation imagery.

It is good when the models created satisfy the following properties: completeness (everything that we wanted to say should be present in the model), consistency (one part of the description should not contradict the other part), extensibility (adding new data should not lead to contradictions). In order for the model to have these properties, the paradigm of model building must allow this. Aristotle's paradigm does not satisfy the requirement of consistency and extensibility of models. That is why the logical paradigm, based on the theory of sets, replaced Aristotelian.

Building one model for more than one object


Having built one model for one object, you can try to see how it fits another object. Or this: you can immediately build a model taking into account the fact that it will describe many objects of the real world. So we get one universal model for multiple objects at the same time. This makes it very easy to describe the real world. We find objects with something similar to each other and describe them with one model. Of course, some individual features will have to be “added” for each model separately, but these are trifles in comparison with the individual description of each object separately. This is what we do when we create a drawing, on the basis of which one functional object can then be created, and maybe a lot! These objects form a set, or class. About any object of this class, we can say that the drawing is its model. Aristotle used another rhetoric. He said that the drawing is a description of the type of objects. And objects are instances of this type.

What does a screenwriter do? He makes the script, but he does not know whether the play will be staged on it and how much will be in the end of the performances. The scenario can be a model of one speech, for example, the celebration of the New 2015. Or he can simulate many performances, such as the Nutcracker ballet script. It is clear that the script is one, and there are many speeches. In a logical paradigm, this description would look like this: there are a lot of all the performances, a subset of this set - there are speeches made on the basis of the script “The Ballet the Nutcracker”.

The same in the paradigm of Aristotle would look like this. There are objects - speeches. Any speech - there is a copy of the speech. There are other types of objects - these are performances made under the same scenario, The Nutcracker Ballet. Any performance on this script is a copy of The Nutcracker Ballet. The same performance is at the same time a copy of the performance and a copy of the performance The Nutcracker Ballet. In this case, Aristotle should now be a little worried, because he did not say that! It does not have the fact that one object can belong to different types! This is our interpretation based on modeling in the form of ER-diagrams. This and many other things do not allow us to build a consistent model of the domain based on the Aristotle paradigm.

Information Object Model


Thus, in the logical paradigm, objects of one set can be assigned to one model:



The objects that we describe with the same models are called similar and belong to the same class. For example, the class of insects, or the class of bolted connections. In addition, one model can also be represented by a variety of information objects. For example, one model of a bolted connection can have many representations in the form of different sheets of drawing paper with a pattern on it, in the form of sketches in notebooks, and so on. It is clear that all these representations use one notation, but at the same time they are all different:



In the entire set of representations, we are only interested in those that are made according to certain rules. For example, we do not want to consider drawings carved out of stone. To do this, we need to introduce additional rules that will create information objects that will suit us. These rules will make the model of the information objects themselves. So the following hierarchical structure is obtained:



A set of information models is described by a model of information objects. This model is in the heads and people. This model is generated as a result of the use of a special paradigm that considers the object of the domain as an informational one. Then, after applying the notation, the model of information models can be expressed in the form of representations of this model.

Thus, any object can have a model and its representation. In turn, the representation can also have its own model and so on to infinity. This infinity is one of the very serious limitations of the logical paradigm. I do not know how to resolve this contradiction. But honestly I admit that the limitations of the logical paradigm are there, and they are that sooner or later we will have to break the chain of models and refer to common sense.

Contract


If we apply the constructed structure to the diagram drawn at the very beginning of the article, then we have questions: what is agreement? Is it a reality, or a model of reality? What is a contract? What are seals? What is an MS Word file? What is the record in the database? And what does it fix: a contract, an agreement, a reality?
I drew a piece of the model, starting with the agreement, but did not decipher what the agreement itself is.



We see that the real domain model is quite complex. At the same time, we did not draw all the details and did not draw all levels of the model, because the ability to work with MS Word does not imply knowledge of the data storage format. And knowledge of the data storage format does not mean knowledge of the print head management rules. And so on. There are physical objects and subjects, there are informational objects and functional ones , and they are sometimes connected by rather complex hierarchical connections. We must learn to model these connections and pass them on to others as knowledge.
For example, the 7-level OSI network model is a hierarchical model of physical and information objects.

In a shortened version of the model is as follows:



And this is already a recognizable design. It excludes entities that can be skipped from the data modeling point of view. But now, looking at her, you know about the connections that bind them. Sometimes, to build a correct model, you need to know a lot more than what is drawn. And my article just demonstrates the course of thoughts that anyone can do in order not to be mistaken. Try to reflect on any question in your subject area. Try asking questions until you begin to clearly understand what you see. Otherwise it will be like this:
Lyrical sketch
We are color blind. Only not in the sense: colors are not distinguishable, no. We do not distinguish between the meaning of words used in different contexts.

The fact that we say abbreviated phrases whose meaning is determined by the context is a necessary measure for survival. We should be able to quickly communicate: Look: a hungry wolf! instead of: Look: an object belonging to many wolves, at the same time belongs to the class of hungry living beings! But, using abbreviated phrases, we should not forget about their full meaning, and should be able to restore this meaning. However, while the reverse process takes place: using abbreviated elements of the language, we move further and further away from understanding what lies behind them.

When I go to the village, I prepare for the feast of hearing. The conversation of the village is full of meaning, color and music. I see that, while uttering words, a countryman does not just juggle with mental constructions, as is customary in the urban environment, he simultaneously experiences images hidden behind words and is immersed with his whole being in the context in which these images live. The experience of images and context as a basis retains the integrity of the structures, and does not give rise to contradictions.

Unlike a village man, a city dweller, taught to perceive words out of context, can use standard language patterns. This leads to a loss of context first, and then blur the meaning of the words themselves. The separation of words from the context does not allow to keep the integrity and consistency of the structures. As a result, a forgery occurs: a set of language patterns replaces knowledge. Since the listeners of such a person are often the same as him, who are unable to simultaneously hold the meaning and context in their consciousness, this focus passes. I meet masters of juggling with words. These are those who are able to change the context, and in accordance with this change the language patterns: psychotherapists, teachers, fraudsters and good politicians, good analysts. But bad teachers, for example, do not understand what the secret of such flexibility is and can only imitate the actions of good ones. The secret is simple - experiencing the context gives you the opportunity to preserve integrity, and the ability to change the context gives you the opportunity to create.

Let's return to the question asked at the beginning of the article. I asked that model that element with a bent corner? I will leave this question open. Try it yourself to correctly put the question and think about the answer.

Source: https://habr.com/ru/post/246313/


All Articles