Generalization Aggregation

Since the 1980s there has been a rapid amplification in the development of many new database systems that have more demanding database requirements than those of the traditional applications. As the basic concepts of ER modeling are often not enough to represent the requirements of the newer complex applications which therefore stimulated the need to develop additional 'semantic' modeling concepts. Various semantic data models have been proposed, and some of the most important semantic concepts have been successfully incorporated into the original ER model. The ER model supported with additional semantic concepts is called the Enhanced Entity-Relationship (EER) model.

There are three of the most important and useful added concepts of the EER model, namely specialization/generalization, aggregation, and composition. In this chapter, you will learn about the main two important concepts. These are:

  • Generalization and
  • Aggregation

What is Generalization / Specialization?

The concept of generalization (specialization) is associated with special types of entities known as superclasses and subclasses, and the process of attribute inheritance. Database managers begin this section by defining what superclasses and subclasses are and by examining superclass/subclass relationships. The ER Model has the capability of articulating database entities in a conceptual hierarchical manner. As the hierarchy goes up, it generalizes the view of entities, and as you go deep in the hierarchy, it will provide with the detail of every entity included. Going up in this structure is called generalization, where entities are associated together to represent a more generalized view. A generalization is a bottom-up approach.

In generalization, some entities are accommodated together into one generalized entity or category based on their similar characteristics. In the below-mentioned figure, whale, shark, and dolphin are generalized as fish, i.e., they have been categorized as the fish.

  • Super-class: An entity type that includes one or more dissimilar sub-groupings of its occurrences that is required to be represented in a data model.
  • Sub-class: A distinct sub-grouping of occurrences of an entity type that require being represented in a data model.

Generalization

Super-class/Subclass Relationships

Each member of a subclass is also a member of the superclass, i.e., the entity in the subclass is the same entity in the superclass, but has a different role. The relationship between a superclass and a subclass is one-to-one (1:1) and is termed as a super-class/sub-class relationship.

What is Aggregation?

A relationship represents a connection between two entity types that are conceptually at the same level. Sometimes you may want to model a 'has-a,' 'is-a' or 'is-part-of' relationship, in which one entity represents a larger entity (the 'whole') that will consist of smaller entities (the 'parts'). This special kind of relationship is termed as an aggregation. Aggregation does not change the meaning of navigation and routing across the relationship between the whole and its parts.

An example of aggregation is the 'Teacher' entity following the 'syllabus' entity act as a single entity in the relationship. In simple words, aggregation is a process where the relation between two entities is treated as a single entity.

Specialization and Aggregation


Courses
Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.