From: Adam Van Den Hoven Date: 2005-10-27T06:37:52+09:00 Subject: Re: The "perfect" ORM? I'm not sure if this is relevant but in my opinion the perfect ORM is no ORM. Why do we think we need ORM? Why do we build wonderful things like Rails? Because our applications have objects and we need to persist those objects in a useful way. We want to be able to find those objects and change them and save them. Personally, I'm willing to sacrifice a LOT to get really simple object persistence. Then again I'm not writing applications that need to handle tens of thousands of object finds every second. I would love to be able to do something like: class Person < ActiveObject::Base field :last_name, String field :first_name, String has_many :aliases, String transient :some_transient_value belongs_to :team has_many_ordered :roles #methods and the like end This would be enough to create a basic object, its schema, and everything else. We might also do: field :last_name, String, validate_max_length( 55 ), validate_min_length( 10 ) After creating your class you would have to run some sort of generation script to create your database tables. Beyond that, you would get an object that works (in my perfect world) exactly like ActiveRecord objects do. I realize that this makes certain common database optimizations impossible. I'm not sure that's a problem, like I said, I don't do large scale applications. Adam On 25-Oct-05, at 5:11 PM, Hal Fulton wrote: > 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 > > > > > > > >