Specialization Enhanced Entity Relationship Diagram Ashima Wadhwa Enhanced















- Slides: 15

Specialization &Enhanced Entity. Relationship Diagram Ashima Wadhwa

Enhanced (Extended) ER Diagrams • Contain all the basic modeling concepts of an ER Diagram • Adds additional concepts: – – – Specialization Generalization Subclass/super class Aggregation Inheritance • Extended ER diagrams use some object-oriented concepts such as inheritance. • EER is used to model concepts more accurately than the ER diagram.

Specialization • Specialization is opposite to Generalization. It is a top-down approach in which one higher level entity can be broken down into two lower level entity. In specialization, some higher level entities may not have lower-level entity sets at all.


Specialization • The process of defining a set of subclasses of a super class. • Specialization is the top-down refinement into (super) classes and subclasses • The set of sub classes is based on some distinguishing characteristic of the super class. • For example, the set of sub classes for Employee, Secretary, Engineer, Technician, differentiates among employee based on job type. • There may be several specializations of an entity type based on different distinguishing characteristics. • Another example is the specialization, Salaried_Employee and Hourly_Employee, which distinguish employees based on their method of pay.

Generalization • Generalization is a bottom-up approach in which two lower level entities combine to form a higher level entity. In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity.

Generalization • The reverse of specialization is generalization. • Several classes with common features are generalized into a super class. • For example, the entity types Car and Truck share common attributes License_Plate. No, Vehicle. ID and Price, therefore they can be generalized into the super class Vehicle.


Aggregation • Aggregation is a process when relation between two entity is treated as a single entity. Here the relation between Center and Course, is acting as an Entity in relation with Visitor.


Inheritance • Terms such as super class, subclass, or inheritance come to mind when thinking about the object-oriented approach. These concepts are very important when dealing with objectoriented programming languages such as Java, Smalltalk, or C++. For modeling classes that illustrate technical concepts they are secondary. The reason for this is that modeling relevant objects or ideas from the real world gives little opportunity for using inheritance.

Sub classes and Super classes • In some cases, and entity type has numerous sub-groupings of its entities that are meaningful, and need to be explicitly represented, because of their importance. • For example, members of entity Employee can be grouped further into Secretary, Engineer, Manager, Technician, Salaried_Employee. • The set listed is a subset of the entities that belong to the Employee entity, which means that every entity that belongs to one of the sub sets is also an Employee. • Each of these sub-groupings is called a subclass, and the Employee entity is called the super-class. • An entity cannot only be a member of a subclass; it must also be a member of the super-class. • An entity can be included as a member of a number of sub classes, for example, a Secretary may also be a salaried employee, however not every member of the super class must be a member of a sub class.


Rules to relationship • All statements that are made about a superclass also apply to all subclasses. We say that subclasses "inherit" attributes, associations, and operations from the superclass. For example: If the superclass Freight has an attribute Weight, then the subclass piece of luggage also has an attribute Weight, even though this attribute is not listed in the subclass Piece of Luggage. • Anything that can be done with an object of the superclass can also be done with an object of the subclass. For example: If freight can be loaded, pieces of luggage can also be loaded. • In the terminology of the system that is being modeled, a subclass has to be a special form of the superclass. For example: A piece of luggage is a special case of freight. The counter-example to this is: A flight is not a special case of a flight number.

Queries?