Database Reference
In-Depth Information
hierarchy are said to be super-elements while their children are called sub-elements. Parent element is
also referred to as a domain, scope or context for its children.
To model a hierarchy of elements, COQL introduces a special relation among concepts, called inclusion .
For example, assume that concept Savings describing savings accounts is included in concept Account:
CONCEPT Savings IN Account
IDENTITY
CHAR(2) savAccNo
ENTITY
Amount balance
This declaration means that instances of the Savings concept will be identified by two digits within
an instance of the Account concept. Any reference to a savings account consists of two segments: main
account number and relative savings account number. An account in this case is a set of savings accounts
which are all distinguished within this main context by means of their relative identifier. The most im-
portant difference from inheritance is that one parent may have many children. In contrast, if Savings
were a class inheriting from class Account then any new instance of Savings would get its own account.
Thus the advantage of concepts is that they allow us to describe a hierarchy where one account may
contain many sub-accounts which in turn may have their own child objects. This hierarchy is analogous
to conventional postal addresses where one country has many cities and one city has many streets so
that any destination has a unique hierarchical address. Inclusion is also analogous to element nesting in
XML where any element may have many child elements.
An important property of inclusion is that it is equivalent to inheritance under certain simplifying
conditions and this is why we say that inclusion generalizes inheritance. Namely, inclusion relation is
reduced to conventional inheritance if identity class of the child concept is empty. In this case only one
child can be created and this child shares identity with its parent. For example, if concept Special describ-
ing accounts with special privileges has no identity and is included in concept Savings then effectively
it extends the parent concept and behaves like a normal class:
CONCEPT Special IN Savings
IDENTITY // Empty
ENTITY
INT privileges
This compatibility allows us to make smooth transition from classical inheritance to more powerful
inclusion which is a novel, more general, treatment of what inheritance is. In concept-oriented terms, to
inherit something means to be included into it and to have it as a domain, scope or context.
Inheritance is one of the corner stones of object data models but it has one problem: classes exist
as a hierarchy while their instances exist in flat space. Indeed, parent classes are shared parts of the
child classes while parent objects are allocated for each new child and all objects have the same type
of identity. Concepts and inclusion eliminate this asymmetry so that both concepts and their instances
exist within a hierarchy.
Having object hierarchy is very important in data modeling because it is a way how one large set of
objects can be broken into smaller groups. Probably, it is the solid support of set-oriented operations
Search WWH ::




Custom Search