From: Alexandru Popescu Date: 2005-10-26T21:25:13+09:00 Subject: Re: The "perfect" ORM? #: Hal Fulton changed the world a bit at a time by saying on 10/26/2005 2:11 AM :# > For many weeks I have had this at the back of my mind. > > I want a really good ORM that is highly non-intrusive > (e.g., I don't have to inherit and I don't have to > clutter my classes and objects with metadata). > > Someone told me that this was much the way Hibernate > works in Java. I can't comment. > > So anyway, this is one of my highest priorities -- to > make an ORM (that works the way I like) to wrap > KirbyBase. (With additional code, it should/could wrap > any other db, of course.) > > Logan's KirbyRecord was a step in the right direction, > it seemed to me. But it was like ActiveRecord -- it > forced you to store your metadata in your own objects. > > Og is cool, but is even more intrusive. > > In case anyone is morbidly curious, I want this so that > I can continue work on Tycho without getting bogged > down in data storage issues. (Someone teased me at the > conference that a year had gone by, and Tycho still > hadn't progressed any. And he wonders how that spider > got in his salad.) > > Anyhow: Who knows Hibernate and can comment on its > usefulness as a model? > > And who if anyone is interested in working on this > project? > > > Thanks, > Hal > > > > > Hi Hal! I've been working with Hibernate for quite a while and imo it is correctly approaching so called object - relational mismatch. The real good thing about this approach is that it is not obtrusive in any ways with your domain model objects and it let's you focus and work only on the objectual world. On the dark side of the problem: you should provide in some way the mapping between the object world and the relational world. While there are a few things that could be a little simplified (like automatic type conversions), the big problem is the impossibility to use this simplified form on relationships. If the parametrized types would have been implemented without the erasure mechanism than this simplification could be brought further, but for the moment we have to use some other way to describe relations: and here comes into play the metadata. There are a few different approaches used: metadata through external XML, metadata through javadoc comments and lately metadata through annotations. There have been long discussion about the benefits and pitfalls of each of these approaches, so I will not enter this discussion here. hth, ./alex -- .w( the_mindstorm )p.