More Tribal

  • The Tribal Pizza Website
    Now that you've looked behind the curtain, come see what's on stage!

Enter your email address:

Delivered by FeedBurner

« Fun With Animoto | Main | How do we secure your password you ask? »

September 16, 2007

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834542cf669e200e54ef370798834

Listed below are links to weblogs that reference Dealing With The Database - The Great Impedance Mismatch (Part I):

Comments

Kaizyn

Obviously the data you work on isn't very important. Otherwise, you would care about data integrity which is the problem relational databases solve.

gregjor

Another fine example of the "I want things to work my own special way, and anything that doesn't work that way sucks" style of programmer whining. People usually outgrow this kind of immaturity before they turn 10. Maybe your needs and what you want are really so new and important that relational databases suck by comparison, but I doubt it.

RDBMSs pre-date OOP, so it's pretty stupid to complain that databases suck because you can't be bothered to learn how to design or use them. Why not complain that your tools don't have any robust way to write and read objects to/from permanent storage? Do you think that OOP might be flawed because it can't do simple things like query a collection of objects for matching instances? You have it backwards -- databases don't suck, something else in your equation does.

I have some helpful tips on relational databases here if you're interested in upgrading your database skills:
http://typicalprogrammer.com/databases/abject-oriented-databases/

David Avraamides

Most data access layers look simple and elegant for simple problems. The true test of them comes when you have to do something more complicated (self-joins, outer joins, compound boolean expressions, grouping and aggregation).

The funny thing is that none of these APIs really works as well as SQL does. In the end, your better off spending your time learning how to use SQL effectively, then trying to learn some other API (or invent your own).

Michael Webb

I really appreciate your feedback. Actually, I am fairly versed in three versus of SQL (SQL Server 2000, SQL Server 2005 and MySQL).

I guess I was confused on the purpose of RDBMS. I thought an RDBMS was one that realized some or the entire relational model proposed by E.F. Codd. Data integrity (if you mean as to apply constraints to data and relations and enforce them) is part of that model. If you mean use of transactions, it is not; however it is an important feature for data integrity and one of the key reasons to use an RDBMS even if it doesn't quite match.

Obviously, my attempt at levity when dealing with the impedance mismatch that exists between our different tool sets wasn't well received. Too bad. This isn't that funny of a problem when you consider the big dollars that have been thrown at trying to solve the problem that OOP and RDBMS (and XML) don't play that well together. We as developers collectively spend lots of time writing boiler plate code to overcome these barriers.

Many in the software industry are devoting big resources to tackling the difficult impedance mismatches between OOP, RDBMS, and XML.

One need only look at toolkits like CSLA, Hibernate, the work in SQL Server 2005, and the upcoming capabilities in LINQ for C# 3.0 to see that many realize this is a problem.

Yes, the real challenge to any O-R mapping is dealing with joins, expressions, and aggregation. Some of these will fall to the way side. The one's I don't need or use won't be supported.

DavidM

The problem with ORM is not the tech, its the approach.

Suppose you have 3 tables, Foo,Bar and Baz. Foo has many Bars, and Foo has Many Baz.

The first thing a typical hibernate/ORM programmer would do is make Foo, Bar and Baz into three objects, write mappings, and DAOs(if needed) to handle access.

The problem is typical usage of Foo,Bar and Baz *does not* need all the data from any of them.

A typical UI shows a subset of data being manipulated in the database. This concept is so prevalent SQL has a keyword for this *join*.

The representation of the data does not necessarily match the view of it, and often doesn't.

A better approach is make entity objects which match your user interface. The other method doesn't utilize the RDBMS it duplicates it in Java/C#.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment