Classification. Classification is the means by which we form and distinguish between
different classes of phenomena. That is we form concepts. Having identified
phenomena and their properties and concepts, we group similar phenomena and
concepts. A classification is often called a taxonomy. It is very common to construct
taxonomies to compare various subjects. When classification is applied repeatedly,
classification hierarchies may be obtained.
Composition. A phenomenon may be understood as a composition of other phenomena, i.e.
there is a distinction between the whole phenomena and their component phenomena. A
car consists of body, four wheels, motor, etc. A process of making pizza may be
understood as a composition of several sub-processes, including: making the dough,
making the tomato sauce, preparing the topping, etc. Repeated application of
composition leads to composition hierarchies.
In class-based languages, classification may be represented by class/subclass hierarchies
(inheritance). The use of inheritance for this purpose is often mentioned as one of the main
characteristics of object-oriented languages. In the object-oriented literature, there is a lot of
discussion of single versus multiple inheritance. This will be further discussed in section
4.2.
Composition has been supported by programming languages for a long time. Algol 60
[Nau63] supports composition of procedures, Pascal [Wir71] supports composition of
record variables, etc. In object-oriented languages, composition has often been neglected
since inheritance has been (mis) used also to achieve composition. In the design of BETA,
support for composition has been just as important as support for classification
(inheritance). (Composition will be further discussed in section 4.1.)
Identification is supported in BETA by means of so-called singular (classless) objects. It
is possible to describe an object directly without describing it as an instance of a class. In
real world modeling, it is often the case that such singular objects are identified and it is not
necessarily a good idea to describe them as instances of some concept. From a technical
point of view this is also found in Pascal where a variable may described directly without
being an instance of a type. Similarly an inner block in Algol 60 is a singular procedure
instance. However, no other class-based language supports singular objects with the same
generality as BETA.
In summary: class-based languages are in general based on modeling the real world in
terms of phenomena and concepts. They are good at modeling an Aristotelian view of
concepts. They all support classification, some support composition, but few support
singular objects. No class-based language is well suited for supporting a prototypical view
of concepts. An explicit conceptual framework should be formulated in order to guide
analysis, design and implementation and to identify the limitations of the programming
languages. The conceptual framework should continuously be developed.
Do'stlaringiz bilan baham: |