Chapter 6
Chapter 6
Chapter 6
The weak entity set must have total participation in the identifying
relationship.
• To distinguish weak entities that depend on one particular identifying
entity (strong entity) an attribute or set attributes in the weak entity
set is used. Such an attribute or set of attributes is referred to as
discriminator.
Classes and Objects – Classes are types (molds or templates) for similar
set of objects. And objects are instances of classes. Every object has
(current) state and behavior.
• Example: For a Vehicle class: - Color, Make, Model, Gas are states and
Driving, Parking are behaviors
• Attributes are (usually) elements with a type that does not involve
classes. They can be of simple, enumerated or structured type. The
syntaxes for the three types are as follows, respectively:
• Example:
- Consider the “EMPLOEES” class partial declaration.
Relationships in ODL
• Unlike E/R design the relationships in ODL model are only binary.
Hence for every relationship in class C there is an inverse relationship
in the related class D. Suppose class C has a relationship R to class D,
then class D must have some relationship S to class C. R and S must
then be true inverses. That is; if object d is related to object c by R,
then c must be related to d by S.
• Example:
- Consider the “EMPLOYEES” class and its relationship to “TEAMS”
class.
• Inverse relationship in ODL design is represented by using the
keyword inverse.
Multiplicity of Relationships
• every object has an object Identifier and keys are attributes that can
identify an object uniquely for the set of objects.
In ODL any number of keys for a class can be declared by adding the
following code after the class name.
• A key consisting of more than one attribute needs additional
parentheses around those attributes.
Example:
• For each class in ODL there is an extent, the set of existing objects of
that class. Extent is the relation with that class as its schema
(definition). It is indicated after the class name, along with keys, as:
• Conventionally, singular nouns are used for class names and plural for
the corresponding extent.
Example: