Explain the concept of a subclass and superclass with the help of an example. What do we call a class/subclass relation?
Say you have an entity type PET with an attribute Species. Within the PET entity set, you might have a bunch of entities with Species=Cat. There might also be some additional attributes and relationships that only apply to PET instances with Species=Cat. So it could be useful to create a subclass CAT from the superclass PET. You could give the CAT subclass its own local (specific) attrs like ‘Num_of_lives’ and its own specific relationships like CHASES that it has with a MOUSE subclass. The CAT subclass will still inherit all of the attributes and relationships of the PET superclass, in addition to its own local attributes and relationships.
* what do we call a class/subclass relation? superclass/subclass relationship AKA supertype/subtype relationship AKA class/subclass relationship AKA IS-A relationship AKA IS-AN relationship
Define: superclass of a subclass
superclass: the ‘parent’ entity type to which a subclass belongs;
subclass: a meaningful subgrouping of entities of a particular type
Define: superclass/subclass relationship
AKA supertype/subtype relationship
AKA class/subclass relationship
AKA IS-A relationship
AKA IS-AN relationship
the relationship between a superclass and a subclass; entities of the subclass inherit the attribute(s) and relationships of the superclass; a member entity of the subclass represents the same real-world entity as some member of the superclass, but in a distinct specific role; an entity cannot exist in the DB merely by being a member of a subclass, it must also be a member of a superclass
Define: IS-A relationship
AKA superclass/subclass relationship AKA supertype/subtype relationship AKA class/subclass relationship AKA IS-A relationship AKA IS-AN relationship
the relationship between a superclass and a subclass; entities of the subclass inherit the attribute(s) and relationships of the superclass; a member entity of the subclass represents the same real-world entity as some member of the superclass, but in a distinct specific role; an entity cannot exist in the DB merely by being a member of a subclass, it must also be a member of a superclass
Define: specialization
the process of defining a set of subclasses of an entity type; [this entity type is called the superclass of the specialization]; the set of subclasses that forms a specialization is defined on the basis of some distinguishing characteristic of the entities in the superclass
Define: generalization
generalization is the inverse of specialization;
the process of defining a generalized entity type from the given entity types;
a reverse process of abstraction in which we supress the differences among several entity types, identify their common features, and generalize them into a single superclass [“generalized superclass”] of which the original entity types are special subclasses
Define: category
AKA union type; a subclass that represents a collection of entities that is a subset of the UNION of entities from distinct entity types
Define: specific (local) attributes
attributes that are specific to a subclass of a superclass
Define: specific relationships
relationships that are specific to a subclass of a superclass
Discuss the concept of type inheritance.
the type of an entity is defined by the attributes it possesses and the relationship types in which it participates. Because an entity in the subclass represents the same real-world entity from the superclass, it should possess values for its specific attributes as well as values as a member of the superclass. We say that an entity that is a member of a subclass inherits all the attributes of the entity member of the superclass. The entity also inherits all the relationships in which the superclass participates.
Discuss user-defined and predicate-defined subclasses, and identify the differences between the two.
predicate-defined subclasses: AKA condition-defined subclasses * when we can determine exactly the entitites that will become members of each subclass by placing a condition on the value of some attribute of the superclass; * defining predicate: the attribute of the superclass that the constraint is placed on
user-defined subclasses:
Explain disjointness and completeness constraints on specialization.
disjointness:
completeness:
List some of the insertion and deletion rules that apply to specialization (and generalization) as a consequence of the constraints specified on them.
What is the difference between a specialization heirarchy and a specialization lattice?
specialization heirarchy:
specialization lattice:
What is the difference between specialization and generalization? Why do we not display this difference in schema diagrams?
How does a category differ from a regular shared subclass? What is a category used for? Illustrate your answer with examples.
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: object
UML object == ER entity;
an instance of a class/entity type
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: class
UML class == ER entity type;
a grouping of objects/entities that have the same attributes
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: association
UML association == ER relationship type;
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: aggregation
UML aggregation is a relationship between a whole object and its component parts;
in EER there’s no distinction between aggregation and association: theyre both relationships
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: generalization
[HM] UML generalization == EER subclass/superclass relationship
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: multiplicity
UML multiplicity == ER relationship constraints;
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: attributes
UML attributes == ER attributes;
For each of the following UML terms (see Sections 3.8 and 4.6) discuss the corresponding term in the EER model, if any: discriminator
UML discriminator == ER partial key attribute (for weak entities);