Mwanji Ezana wrote: > On Jul 17, 1:49 am, Christian Catchpole <[email protected]> > wrote: > >> I started work on a "persistence layer" which didn't even try to do >> ORM. It was simply a tool to take the grunt work out of writing joins >> and handing the result sets. >> > > This reminds me of a few anti-ORM blog posts I've been reading > recently. For example: > http://manniwood.wordpress.com/2009/07/02/sql-generation-is-a-templating-problem-not-a-code-generation-problem/ > and a few other posts on the same blog. > > Once you hit things like graph navigation, query batching, caching, > etc. ORM benefits become clearer, I think. > > I get the impression that current ORMs handle the 80% case pretty > well. > People confuse syntax and semantics in that area. People don't understand relational algebra and think SQL is relational algebra. People think objects and relational algebra don't mix.
As opposed to the author of the post I don't want to write SQL. But quite often I don't want to navigate object graphs either, I want to express queries in terms of the relational algebra. "Give me all customers that ordered an item in this category" can be mapped easily into relational algebra, but requires imperative code in the OO world. It can be mapped into SQL, but unless you use custom datatype, "customer" is just another dumb table. Relational algebra always had the notion of "domains". A domain is a class of things and nothing in relational algebra stops these things to be full-blown, polymorphic objects. IIRC modern SQL standards support this, too -- it is only that no one supports those flavours of SQL. And of course SQL has all the historic baggage such as NULLs and the related conceptual burden such as outer joins. I believe if you combine the niceness of encapsulation and polymorphy of objects and the larger structure of relations into one system based on Codd's original work, then you get something nice. I also believe it has been tried, but I am not aware of anything that nicely integrates with Java or a similar language. Wikipedia's entry on object-relational databases is brief: http://en.wikipedia.org/wiki/Object-relational_database -- the list of engines linked from there contains a mere three implementations (Oracle, OpenLink Virtuoso, PostgreSQL). I started an attempt at implementing a Java-based solution for this a long time ago, but I never got far -- just a basic implementation of an in-memory website. It seems nowadays even the virtual host is broken, it should be available at http://beandb.org, but it is accessible only via http://beandb.sf.net at the moment. Peter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
