CSCI 5333 Data Base Management
System
Spring 2002 (1/14-5/6)
Week 2:
Semantic Data Modeling (Ch. 4)
A. Enhanced ER Modeling
concepts
|
definition
|
example
|
subclass
|
|
|
superclass
|
|
|
class/subclass relationships
|
|
|
type inheritance
|
|
|
specialization
|
|
|
generalization
|
|
|
category
|
|
|
union
|
|
|
attribute and relationship
inheritance
|
|
|
EER Diagrams
|
|
|
- Question: Why specialization? HINT:
pp.76-77.
- Class/Subclass properties:
- predicate-defined subclasses,
defining predicates
- disjointness constraint: disjoint, overlapping
- completeness constraint: partial subclasses,
total subclasses
- Multiple Inheritance: specialization/generalization lattice
(see Fig. 4.6)
- Formal Definition: (page 93) A category T is
a class that is a subset of the union of n defining superclasses D1, D2,
..., Dn, n > 1.
- NOTE: The formal definition applies to the whole category
. That is, some instances of the categories may be D1, some D2, etc.
- At the instance level, each instance of the category
is of one and only one of the superclasses. That is, an instance of T is
either D1, D2, D3, ..., or Dn (no overlapping).
- Question: Describe the difference between 'multiple
inheritance' and 'category'.
Ø
Go to the
Index
B. Object Modeling using UML Class Diagrams
- Question: Both EER and UML are examples
of semantic data modeling. Is there anything that can be represented
in UML but not in EER? HINT: p.74.
-
Comparison between EER and UML:
EER
|
UML
|
Examples from p.94
|
Examples from p.96
|
Entity type
|
Class
|
EMPLOYEE
|
|
Entity
|
Object
|
an instance of EMPLOYEE
|
|
Relationship
|
Association (type 1 relationship)
|
WORKS_FOR
|
|
Relationship attributes
|
Link attributes
|
the MANAGES box
|
|
Relationship constraints
|
Multiplicities
|
4..*, 0..1, 1..*, *, 0..*
|
|
Recursive relationships
|
Reflexive associations
|
supervisee / supervisor
|
|
multi-valued attributes
|
Aggregations (type 2 relationship), also
called part-of relationship
|
LOCATION is part of DEPARTMENT
|
|
Weak entity
|
Qualified association/aggregation
|
DEPENDENT
|
|
Inheritance
|
represented as a blank triangle between
a subclass and its super class(es)
|
|
STAFF is a subclass of EMPLOYEE. STUDENT_ASSISTANT
is a subclass of STUDENT and EMPLOYEE (multiple inheritance).
|
Overlapping specialization
|
represented as filled triangle between
the superclass and its subclasses
|
|
A PERSON may be an EMPLOYEE, an ALUMNUS,
a STUDENT, or combination of those.
|
Disjoint specialization
|
represented as a blank triangle between
the superclass and its subclasses (the default inheritance relationship)
|
|
An EMPLOYEE is a STAFF, a FACULTY, or a
STUDENT_ASSISTANT, but not more than one of them.
|
Total completeness
|
? (seems to be missing in UML) |
|
|
C. Modeling of Aggregation (part-of relationship) in EER
Case A
|
as multivalued attributes
|
See Fig. 3.15 (p.65): Locations
|
Case B
|
as weak entities
|
See Fig. 3.15 (p.65): Dependent_of
|
Case C
|
as weak entities in a ternary relationship
|
See Fig. 4.16 (p.104): Interview
|
Question: How is aggregation modeled
using UML? Ans.: See p.94.
Review Questions (p.105)
4.1.
What is a subclass? When is a subclass needed in data modeling?
4.3.
Discuss the mechanism of attribute/relationship inheritance. Why is it
useful?
4.4.
Discuss user-defined and predicate-defined subclasses, and identify the
differences between the two.
4.5.
Discuss user-defined and attribute-defined specializations, and identify
the differences between the two.
4.6.
Discuss the two main types of constraints on specializations and generalizations.
4.7.
What is the difference between a specialization hierarchy and a specialization
lattice?
4.8.
What is the difference between specialization and generalization? Why
do we not display this difference in schema diagrams?
4.9.
How does a category differ from a regular shared subclass? What is a
category used for? Illustrate your answer with examples.
Ø
Go to the
Index
|