Features of the conceptual modeling of the subject area

    I continue a series of articles on the features of conceptual modeling of subject areas. In the last article I showed. how is it possible to associate an object with a class of objects by semantic communication. In the article, I talked about what is meant by the term class in OOP. Today I will tell you why I prefer to build conceptual models in the form of ER diagrams.

    Let us need to model the thesis that each car has 4 wheels. Not a group of four wheels, namely, 4 wheels.

    In terms of ER models, it is customary to say that there is a car, there is a wheel and there is a connection between the car and the wheel. This connection is called a “wheel-car” and is related to one to four. The connection read from the wheels is called: “stands on”, the connection read from the car is called: “has”.



    In terms of OOP they say this: there is a class of OOP cars and there is a class of OOP wheels. There is a one-to-four relationship between these OOP classes. The connection is called: "car-wheel." The connection read from the wheels is called: “stands on”, the connection read from the car is called: “has”.



    We look carefully at the subject area and write what the presentation of the model of the subject area in terms of the logical paradigm will look like.

    In the logical paradigm there is the term class TM, which coincides with the definition of a class in mathematics. This definition is very similar to the definition of a set, and a set, in turn, is a group of objects. So we have many cars and many wheels. Each car has 4 wheels connected with semantic connections “car-wheel”. Thus, for each car there are 4 wheels and 4 semantic links. The semantic connection in the logical paradigm is written in the form of a tuple: (Car No. 123; Wheel No. 234). All tuples belong to a class, or many tuples. This set of semantics unites: “A wheel stands on a car”. There is only one semantic connection between a particular wheel and the car on which this wheel is mounted. This relationship is one to one. How then to say that 4 wheels are installed on one car? In the logical paradigm, it is pronounced like this: for each car there are 4 links with wheels in the semantic link class called “The car has a wheel”, for each wheel there is only one such link in this class.



    Thus, to model one car, we needed 4 connections between the car with the wheel, and not one, as is the case with the ER model, and not one, as is the case with the class diagram. This is logical: one car has 4 wheels. On the diagram, arrows indicate the connection "classification".

    Is there a semantic connection between the TM car class and the TM wheel class? In this formulation of the problem, no. There is a class of connections between cars and wheels, but there is no connection between the class of TM cars and the class of TM wheels.

    Let us now consider another problem. Let it be necessary to simulate the fact that cars have a group of wheels. Not wheels, but a group. In mathematics, the term set is responsible for defining a group. In mathematical language we must say: a car has many (group) of wheels. This means that we postulated the possibility of connecting the object and the class of objects with a semantic connection. How to model this thesis in a logical paradigm?

    For this, we distinguish such classes of wheels from the TM wheel class, each of which belongs to one machine. So we connect the car and the group of wheels related to this machine. In the model, it will look like this:



    Arrows still indicate a classification relationship, but a circle indicates a specialization relationship, or “set-subset”.

    In this diagram, we see that the object the car is connected with the class of wheels by the semantic connection “has”.
    Such a model is no longer representable in the form of a class diagram or in the form of an ER model. In addition, no modern ontological standard has the ability to model such relationships. The reason is simple: the difficulty in implementing such relationships in OOP programming languages.

    Note that class diagrams do not model classes of objects: rectangles on class diagrams model types of objects.

    But with ER diagrams more interesting. What is indicated by a rectangle in the ER diagram is the class of TM objects. Therefore, it is incorrect to call a rectangle in the ER model a noun in the singular. Correctly called a noun in the plural. Then the model will be like this:



    And this model brings us closer to the model of TM classes. However, the relationship between the TM classes does not actually exist, but there are links between TM class objects, and they are read as follows: for each car there are 4 links with wheels in the semantic link class called “The car has a wheel”, for each wheel there is only one such connection in this class.

    Conclusion: conceptual modeling in the form of ER is much closer to the logical paradigm than modeling in the form of class diagrams. But neither the one nor the other modeling method allows modeling the semantic relations between objects and classes of objects. This is a significant limitation of modern modelers, which must be addressed.

    Also popular now: