Supertypes
Explore the concept of supertypes to understand how generalization simplifies object modeling by centralizing shared attributes and identifiers. Learn to apply these principles in JavaScript to manage inheritance and associations effectively while building front-end applications.
We'll cover the following...
We'll cover the following...
Supertypes by generalization
We illustrate generalization with the example model shown below:
After we add the object type Employee we can see that Employee and Author share a number of attributes. For example, employees and authors are both people, and these are also roles played by people. So, we may generalize these two object types with a joint supertype Person, as shown in the diagram below:
Generalizing two or more objects
When we ...