OO Properties: Modeling Features (Cont.)
Types and Classes
- A type is a time-invariant description of a set of possibly complex values.
A type can thus be a base type of structured; no specific operations are bound to a type apart from generic ones.
A type in an OODBS only describes the structural part of a class.
- A class encapsulates structure and specific behavior.
Moreover, class is a run-time concept such that the set of objects in existence at a given point in time, the so-called instances, can be allocated to it as its extension.
Inheritance
If the objects of class K1
are more special than those of class K2
, K1
will be defined as a subclass of K2
with the effect that K1
inherits the structure of K2
.
- Without inheritance, six programs must be written for the following two objects:
- Using inheritance, only four programs are needed: