What is a subclass? When is a subclass needed in data modeling?

Tobias Ali

Tobias Ali

Answered question

2021-09-25

What is a subclass? When is a subclass needed in data modeling?

Answer & Explanation

Pohanginah

Pohanginah

Skilled2021-09-26Added 96 answers

An object class can specialize into subclasses if they have different attributes or use different services. A subclass is a subset of a group of entities (that have something in common) that is actually a new entity in the database. It can define new attributes and methods.
A subcclass is a subset of a superclass. For the superclass, the identifier and all properties common to all subclasses are given. For each subclass, only its specific properties, if any, are listed. Entities of the subclass may still share the majority of their attributes with the other members of the superclass. An entity cannot exist in the database merely by being a member of a subclass. it mutst also be a member of the superclass. Such an entity can be included optionally as a member of any number of subclasses.
For example, a student attending 2 faculties belongs to two subclasses - COMPUTER.SCIENCE study and PEDAGOGY study. Both entities are in the STUDENT superclass. However, it is not necessary that every entity in a superclass is a member of some subclass. An entity class (subclass) is a specialization if it is a special case of another entity class (superclass).
There are two criteria for the introduction of specialization, namely the subclass has specific classification properties in relation to the superclass and the subclass has specific links in relation to the superclass.
Subclass is needed in data modeling because it is very ensy to define the inheritance relationship between two classes in database.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?