Composition relationship and specialization relationship
Objects are arranged in a hierarchy based on three fundamental relationships:
- Part-Whole. The simplest and most important relationship, which only applies to physical objects. Also known as "true part" to distinguish it from parts of descriptions or random parts of something.
For example, a table leg is a part of the whole table. My hand is a part of me.
To consider a part as part of a whole, mentally divide the whole into parts. It is important to ensure that all the space and time occupied by the part is included in the space and time occupied by the whole.
A mental check for verification: all atoms of object "part X" are included in the number of atoms of object "whole Y". If yes, then X is a part of Y.
The hierarchy built on this relationship is expressed in the language as "X consists of...".
In the "part-whole" or composition relationships, the strongest form is the "true part" described above. There are also weaker forms, where we know that not a specific object, but generally every object of that class consists of. Then we talk about composition for non-physical objects, and different ontologists decide differently on what can have composition.
It is based on this principle that subsystems are identified within systems.
Composition: Acorn cap and acorn body
- Class-Instance of a Class. We have a class "tables," and an instance of this class is a specific table existing in physical reality.
Classes exist in the mental space, where we can manage and operate them. A specific table is an instance of the class "tables" (and many other classes, meaning one object can be an instance of multiple classes) existing in physical space, which we can observe and touch.
Another class can also be an instance of a class. This class of classes is often similar to a classifying feature. "Tables classified by material" or "material of tables" (class) - "wooden tables" (an instance of a class, which is also a class).
"Showing an instance of a class" is the same as "giving an example." In language, it is noticeable in phrases like "vegetables, for example, this potato" or "programmers, for example, Vasya."
- Superclass-Subclass.
I group concrete tables into the class "all tables" using the relationship "class-instance."
Some of these tables are included in another class - "wooden tables."
All "wooden tables" are also part of the class "all tables" - this is the specialization relationship, where one class includes all instances of another class.
All items in the class "all tables" are also part of the class "furniture." Thus, "all tables" is a superclass for "wooden tables" and a subclass for "furniture."
To identify a subclass for a class, you need to make a narrower selection - specify an additional property so that fewer examples can be given. All objects in the subclass are also included in the superclass.
We can narrow or expand classes by adding or removing attributes. In language, this is expressed as "power plants, in particular, nuclear power plants" or "products, particularly vegetables."
Sometimes people will speak confusingly, like "products, for example, vegetables," as if the class "vegetables" were an instance of the class "products" rather than its subclass. You might have noticed this effect when asking someone for an example, and the person responds just slightly less abstractly (providing a narrower class). Often, this is enough for understanding. However, in this course, we will differentiate between examples/instances and narrower classes.