Reverse ORM

That Object-Relational-Mapping is a difficult Problem is not news.

The usual criticisms are all valid, but what occured to me, after thinking a while about this, is that all approaches I’ve seen so far seem oriented to the object-oriented modeling, trying to map the OO-models to database relations.

What about tackling the problem from the other side? Relations can have huge benefits over object graphs, why not leverage their strengths and, instead of mapping OO to relations, just try to use OO to make dealing with relations easier and more natural in OO languages?

Relational logic is powerful and relatively easy to understand. There are just a few annoyances that should be addressed:

  • Validation
  • Mapping relations to forms
  • Keeping track of associations

This wasn’t in any way thought through by me, it just came to my mind. Maybe there are already some solutions that go this route, maybe someone even proved this to be impractical. The approach seems worth investigating.

…as soon as I find the time :(

1 Comment for 'Reverse ORM'

Nacho

Hi!

Probably you’ve just found the answer by yourself. But in any other case, I can tell you that actually exist ORM tools that support reverse engineering processes. In other words, there are tools that can build an object-oriented hierarchy and a persistence layer having you relational schema as input.

Some examples, SQL2Java or Middlegen. Actually, on hibernate.org Hibernate Tools are also delivered to integrate them into Eclipse IDE. (I think that the last one can be the most interesting choice).

Contact me if you want some feedback! ;)

Arrivederci!

Write a comment

Trackback: http://jan.varwig.org/archive/reverse-orm/trackback
Comment-Feed: RSS2