Unveiling Attribute & Relationship Inheritance in EER Diagrams

The Mechanism of Attribute/Relationship Inheritance and Why it Useful

The enhanced entity-relationship (EER) diagram includes the principles of the entity-relationship diagram with the addition of some other concepts as described by Tupper (2011). The additional concepts include subclasses and superclasses, specialization and generalization, inheritance, and categories.

With entities in a logical model, there are often sub-groups that are of critical interest to the business area that is modeled. For example, let's look at the entity vehicle. Vehicle entities include cars, sports utility vehicles, hybrids, crossovers, and trucks. The vehicle would be a superclass, and the car, sports utility vehicle, hybrid, crossover, and trucks are subclasses.

The critical concept to remember with this is that a subclass is also an occurrence of a superclass. It simply fulfills a different role, as described by Tupper (2011).

The superclass and subclass are connected to the concept of attribute inheritance. A definition of inheritance, as described by Tupper (2011), is the subclass or child of the superclass contains qualities or characteristics of the parent, also known as the superclass. An entity in a subclass represents membership in the superclass, too, because it inherits the properties and attributes of the superclass entity. The concept to remember is that the properties and attributes are inherited and the relationship that the superclass participates in. The term specialization is the method of describing the subclasses of a superclass. The subclasses that form a specialization are defined by criteria of different subclass entities in the superclass, as pointed out by Tupper (2011). The vehicle type attribute is the specialization characteristic in the abovementioned vehicle (the car, sports utility vehicle, hybrid, crossover, and truck). Several specializations of an entity type are based on other identifying or specialization characteristics. One example would be the subclasses of specialization of front-wheel drive, rear-wheel drive, all-wheel drive, and four-wheel drive as defined by the specialization characteristic drivetrain. If all members of the subclass have the same attribute value of the same attribute in the superclass, then the specialization is called an attribute-defined specialization.

An example of this is the vehicle type example described early. Suppose there is a condition to the value of an attribute that defines whether the subclass occurrence is a member of the subclass. In that case, it is called a predicate-defined specialization. An example of this would be a constraint that the value in the vehicle type attribute would have to be the car for the occurrence to have membership in the car subclass. Depending on the value of the attribute vehicle type, an occurrence will be in one subclass or another. If the subclass has a specialization and it is neither of the preceding, it is called a user-defined specialization. This can take whatever form is necessary for the application. Generalization is the opposite of specialization.

Generalization does not allow attribute grouping of the subclasses into a superclass. In the example, cars, sports utility vehicles, hybrids, crossovers, and trucks are all subclasses of vehicles. The vehicle is a generalization can be viewed as the opposite of the specialization. The first example of a generalization used above was the vehicle and the second was drivetrain.

The category contains two or more superclasses and may characterize groups of entities from distinct entity types. Superclass, along with subclass relationships, always has a single superclass as described by Elmasri (2015).

Attribute and relationship inheritance is helpful because it allows you to reuse the attributes of other classes or objects where the class or objects would be exactly the same.

References

Elmasri, R., Navathe, S. B. (2015-06-01). Fundamentals of Database Systems, 7th Edition

[VitalSource Bookshelf version]. Retrieved from (https://bookshelf.vitalsource.com/books/9781323139899)

Tupper, C. (2011). Data Architecture. : Elsevier Science. Retrieved from http://0-www.ebrary.com.nell.boulderlibrary.org

Posts in this series