Domain Model

Let's go over the domain model of a single table inheritance relationship.

We'll cover the following...

This chapter is a primer to the process of development with a single table inheritance relationship. We will create the user interface at the beginning and then write the real service. In the end, we will integrate both the solutions and arrive at a reasonable conclusion.

Different types of objects may have something in common with each other. Object orientation allows classes to inherit common attributes and methods. This is called Inheritance. Generalization is the art of extracting shared attributes and methods from a related set of classes and forming a generalized superclass. On the other hand, Specialization is to form a subclass with attributes and methods specific to the subclass. In this chapter, we will look at the first approach to handling inheritance in object-relational modeling.

We will begin with a single table inheritance relationship, as shown in Figure 14-1. The Protocol entity has an identifier, a name, and a field known as discriminator, which denotes the difference between an SNMP (Simple Network Management Protocol) and a TCP (Transmission Control Protocol). Here, the generalized superclass is Protocol, and the specialized subclasses are SNMP and TCP. Let’s start by discussing how the user interface is developed.