Name

Table Inheritance Pattern

Goal

Provide a simple mapping between a class hierarchy and a set of database tables.

Participants

Domain object model

Provides an object representation of the data a system must deal with.

Database schema

Provides a method to store and query against the data in the domain object model.

Interactions

Concrete table inheritance

Each concrete class in the domain object model has a corresponding table in the underlying database schema. When the object model is persisted to the database, each object is written to a row in the corresponding table.

Class table inheritance

Each class in the domain object model, whether abstract or concrete, has a corresponding table containing the data items defined in that class. Tables associated with a subclass are linked within the database, via primary key relations, with the table associated with their superclass.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset