>>
Passionate about your results
  About Us      Services      Products    Industries  Partners    Careers    Awards News Contact Us 29

Stay connected with the
worldwide business
community
Relational Data Model – Why does it break? Monday, February 1, 2010

The concept of relational model is based on set theory. A relation is a set. A set is made of unique (i.e. non-duplicate) elements. A relation can be represented as a table. No two columns in a table can be the same. A subset of A can have at most all the elements of A. A given view on a table (i.e. ignoring join scenarios, since they define new sets) can at most have all the columns in A.

Now considering an Entity model of a table A (Hibernate/java, Entity Framework/C#, ActiveRecord/ruby), a table is represented by an Entity class and rows as instances of that Entity. By definition, classes allow “Inheritance” unless explicitly defined otherwise. “Inheritance” allows attributes to be “added” i.e. it “breaks” the definition of a set.

Under no circumstance in set theory, can a subset “add” new elements to its parent set because it would negate the definition of a subset. But in an object-oriented world, this is exactly what happens through “Inheritance”.

A parent class definition is “extended” through additional attributes/methods in child/subclass. So now the subclass is a “superset” of the parent class and there by has lost all “set based” foundation i.e. now JOIN,UNION,INTERSECTION will be useless, because there would different results based on how deep or how shallow one stands on the inheritance hierarchy.

In another perspective, relational/set model is deterministic i.e. # of elements are governed by a rule whereas an inheritance model is non-deterministic i.e. a class can extended to any extent and there are no rules to govern what attributes (instance variables) may or may not be added. This is true even in the case of “Single Inheritance” driven languages — Java/C#/ruby. This lack of ability to control “inheritance depth” is what creates the object relational mismatch.

Posted by Srinivasan Balram | No Comments
Post a Comment

Name:


Email Address:


Website:


Comments:


 
  Blogger Profiles
 
 
 
 
  Linked in
 
 
 
 
  Marlabs on
Facebook
 
 
 
 
  Follow us
on Twitter
 
 
 
 
  Read our Feed