2.2.1. Generalization / specialization

In some cases, there are occurrences of an entity that has specific characteristics that we are interested in modeling. For example, even if you want to keep track of what car companies are assigned to employees who are managers, and also that of the technical staff, want to have a relationship with an entity project indicating what projects are working and want to register titer. Finally, you know the age appropriate administrative employees. Likewise, there are some features common to all employees: all are identified by an ID, they have a name, surname, address and telephone number.

The generalization / specialization can reflect the fact that there is a general entity, we call superclass entity that can specialize in subclass entities:

a) The superclass entity allows us to model the common features of the entity view of a generic form.
b) subclass entities allow us to model the characteristics of their specializations.
You must be fulfilled that any occurrence of an entity subclass is also an occurrence of the superclass entity.

Denote generalization / specialization with an arrow from the subclass entities and is directed to the entity superclass.

Example of superclass and subclass entities

In the following figure are represented the superclass entity, which corresponds to the example used above, and subclass entities, under the manager, technician and administrative suit.

In generalization / specialization, the characteristics (attributes or relationships) of the superclass entity are propagated to the subclass entities.This is what is called inheritance of property.

In the design of a generalization / specialization, you can follow one of two processes:

1) It may be that the designer first identifies the need for superclass entity and subsequently recognize the special characteristics necessary subclass entities.In these cases is said to have followed a process of specialization.

2) The alternative is that the designer modelice first subclass entities, and then realize their common characteristics and identify the en-tity superclass. Then is said to have followed a process of generalization.

The generalization / specialization can be of two types:

Our example of employees ...

... Corresponds to a generalization / specialization disjoint because no employee can be more than one type.Is denoted by the label D.

a) disjunct. In this case it may happen that a single occurrence ap-sage in two different subclass entities. Graphically denoted with the label D.

b) overlapping. In this case the restriction does not take place earlier. Graphic-cally denoted with the label S.

In addition, a generalization / specialization may also be:

1) Total. In this case, every occurrence of the superclass entity must belong to any of the subclass entities. This is denoted by the label T.

2) Partial. In this case it is necessary to fulfill the above condition. Is denoted by the label P.

The generalization / specialization of staff

The generalization / specialization of the total employees is because we assume that every employee must be managerial, technical or administrative.Is denoted by the label T.

empleadoT