Re: Database type independence

From: Michael Feathers (mfeathers_at_objectmentorNOSPAM.com)
Date: 08/23/04


Date: Mon, 23 Aug 2004 21:36:14 GMT


"Fredrik Bertilsson" <fredrik_bertilsson@passagen.se> wrote
> Many OO evengalists argue very hard for making the persistance layer
> independent of the database type (RDB, OODB, LDAP, etc). They want to
> be able to change the database from a RDB to an OODB without changing
> the business logic.
>
> But the cost for doing this is very high. The developer is forced to
> implement (or configure) an extra transformation/mapping layer. The
> persistance frameworks becomes unnecessary complex. This requirement
> about database type independance is one of the main reasons that EJB
> is so very complex. Besides, data-aware components are not possible to
> use because of this requirement.
>
> My question is, is it really worth the cost to make the architecture
> independant of database type. On the software market, there are a huge
> demand for relational database vendor independant applications. Most
> customers want to be able to run the applications they buy on their
> favorite dbms system like Oracle, SQL Server, MySQL etc. But how many
> customers want the application to be able to run on their OODB? I have
> never heard about it anyway.
>
> Relational databases have proven to be the superior database type.
> They have almost 100% percent market share and this fact does not seem
> to change in the near future. In fact relational databases is more
> likely to live longer than most programming languages used today
> (Java, C#, C++, PHP, VB etc). There have been numerous examples of
> applications changing programming languages (from Cobol and Fortran to
> Java or VB/C#) and the database remains the same. But the examples of
> changing database type and keeping the application the same is
> extremely few.
>
> Is it really reasonable to invest money in a feature (database type
> independence) that in almost no cases are needed? I think that if IT
> managers really knew that when they are investing in mainstream OO
> architecture, they are also spending money on things they will never
> need, they would make different decisions.
>
> It would be interesting if it is someone out there that actually uses
> something else but relational databases for persistance? And in that
> case, what type of applications and what database vendor. It would be
> even more interesting to know if someone actually have changed from
> relational database to OO database (or something else), whithout
> having to rewrite the business logic.

If the only advantage to an independent persistence layer was the ability to
move to an OODB, all that would be true. But, it isn't the only reason.
When you have a persistence layer, you're really separating concerns. You
can test and use logic independently of the database, work with code in
isolation, etc. I recommend it whenever a system does more than store,
retrieve, and display.

One of the toughest things for people to get past in the industry today is
the sense that the work has to be as hard as it is. I've visited many teams
that have SQL scattered throughout their apps. If you put them next to
teams that don't, their pain is evident. The funny thing is, they just
don't notice that pain until you help them get rid of it.

--
Michael Feathers
author, Working Effectively with Legacy Code (Prentice Hall 2004)
www.objectmentor.com


Relevant Pages

  • Re: Database type independence
    ... > independent of the database type (RDB, OODB, LDAP, etc). ... > implement an extra transformation/mapping layer. ... > about database type independance is one of the main reasons that EJB ...
    (comp.object)
  • Database type independence
    ... independent of the database type (RDB, OODB, LDAP, etc). ... about database type independance is one of the main reasons that EJB ... Relational databases have proven to be the superior database type. ...
    (comp.object)
  • Re: Database type independence
    ... > independent of the database type. ... > about database type independance is one of the main reasons that EJB ... > demand for relational database vendor independant applications. ... > Relational databases have proven to be the superior database type. ...
    (comp.object)
  • Re: Database type independence
    ... > Many OO evengalists argue very hard for making the persistance layer ... > independent of the database type. ... naturally tends to be independent of database type as well. ... > Relational databases have proven to be the superior database type. ...
    (comp.object)
  • Re: What is an OODBMS?
    ... But to me it is still not clear what a OO database actually ... >the programming language. ... OODB - something that very very few people can do. ... PSE-Pro are good ...
    (comp.object)