Mapping of inherited object structures   /   

Mapping of inherited object structures

Being object inheritance one of the most used features in object oriented design, it has come out to fit difficulty in relational structures. With a wide range of mapping possibilities depending on database design and legacy systems, you can reach the best performance.

See our demo implementing all 3 types of inheritance mappin

Following inheritance mappings are currently supported in DADO Database MapperŪ:

Normalized inheritance

Normalized inheritance In this scenario we map the properties of the base class in a table and the properties of the inherited objects in separate tables. This optimizes database but makes the queries more time consuming, requiring a join operation.

Redundant inheritance

Redundant inheritanceIn this scenario we map all the properties of an object (and its base objects) on the same table. Every inherited object has its own table. While optimizing database space and query performance (usually no join required) this makes impossible to search on base types (in this case the type "Animal")

Shared inheritance

Shared inheritanceIn this scenario we map two different object types on the same table. This can be on different columns or even on shared columns with different meaning depending of the object type (for example the column "Owner" may mean "DogOwner" in case of a dog or "Parent" in case of a man).

While this is the fastest solution during queries on base types, it increases database complexity and of course required space.

As seen above the ways to map inheritance are different, and any one brings advantages and disadvantages. If not working with a legacy database schema (where there is no choice), the best choice depends of the requirements.

  • Welcome
  • Introduction
  • About O/R mapping
  • Advantages
  • Architectures
  • Download
  • Sample code
  • Demos & Samples
  • Purchase
  • Facts & Figures
  • FAQ's
  • Press room
  • Impressum

    MSDN Downloads
    MSDN Subs
    Microsoft .NET Oracle Microsoft Access Microsoft SQL Server

    Contact us:
    Technical support, Sale information, Questions

    Copyright © 2004 DADO Solution. All rights reserved.