E/R Subclasses Assume subclasses form a tree (no multiple inheritance) Isa triangles indicate the subclass relation. beers name Manf. isa Point to the superclass Ales color 21
21 E/R Subclasses Assume subclasses form a tree (no multiple inheritance) Isa triangles indicate the subclass relation. beers Ales name Manf. color isa Point to the superclass
Multiple Inheritance name manf manf Theoretically,an E.S. name could be a subclass of several other entity Beers Wines sets. ■Problems? Example:manf means vintner for wines,bottler for beers. What does manf mean for grape beers"? In practice,we shall assume a Grape tree of entity sets connected Beers by isa,with all "isas” pointing from child to parent
22 Multiple Inheritance Theoretically, an E.S. could be a subclass of several other entity sets. Problems? Example: manfmeans vintner for wines, bottler for beers. What does manfmean for “grape beers”? • In practice, we shall assume a tree of entity sets connected by isa, with all “isas” pointing from child to parent. name manf Beers name manf Wines Grape Beers isa isa
Different Subclass Viewpoints E/R viewpoint:E/R entities have representatives in all subclasses to which they belong Rule:if entity e is represented in a subclass,then e is represented in the superclass.Its properties are the union of the properties of these E.S. Object-oriented viewpoint:An object (entity)belongs to exactly one class.It inherits properties of its superclasses. 23
23 Different Subclass Viewpoints E/R viewpoint: E/R entities have representatives in all subclasses to which they belong 9 Rule: if entity e is represented in a subclass, then e is represented in the superclass. Its properties are the union of the properties of these E.S. Object-oriented viewpoint: An object (entity) belongs to exactly one class. It inherits properties of its superclasses
Example,from E/R Viewpoint An entity has a component in each entity set to which it logically belongs. beers name G Manf. Its properties isa Pete's Ale are the union of the properties of these E.S. Ales o color 24
24 Example, from E/R Viewpoint An entity has a component in each entity set to which it logically belongs. beers Ales name Manf. color isa Its properties are the union of the properties of these E.S. Pete’s Ale
Keys A key is a set of attributes such that no two entities agree on all these attributes. In E/R model,every E.S.must have a key. It could have more than one key,but one set of attributes is the "designated key. In E/R diagrams,you should underline all attributes of the designated key. 25
25 Keys A key is a set of attributes such that no two entities agree on all these attributes. In E/R model, every E.S.must have a key. It could have more than one key, but one set of attributes is the “designated”key. In E/R diagrams, you should underline all attributes of the designated key