From: Ezra Zygmuntowicz Date: 2005-09-14T12:13:49+09:00 Subject: Re: KirbyBase [ANN (sort-of)] proof-of-concept KirbyBase ORM --Apple-Mail-5-184054240 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Sep 13, 2005, at 7:57 PM, Logan Capaldo wrote: > > Well after hacking away today for a couple of hours I've come up > with the beginnings of a rudimentary ORM for KirbyBase. I'll post > what I have so far, and people can let me know if they are > interested in a more complete version. It currently looks a lot > like ActiveRecord, but obviously not as powerful. First it doesn't > do ActiveRecords pluralization magic, although that should be easy > to add. Secondly it doesn't have as many variations of find (but > that's mitigated by KirbyBases's use of ruby syntax to perform > selections). I've only implemented one kind of relationship (one-to- > many, or is it many-to-one, some db guy can correct me on my > terminology) using a ActiveRecord-esque has_many method. Some other > problems include that it doesn't yet do ruby-esque getters and > setters (ie. obj.something, and obj.something = value) instead it > has get_something and set_something methods. I did this since I was > just hacking away its easily remedied if anyone shows any interest > in my continuing this. One other thing, it does not make use of > KirbyBase's Link type yet, although if it did, it would probably be > better. Again something to add if anyone really wants to use this. > I learned a couple of things developing this, mostly that > @@variables are evil, and that class instance vars are better. > Without further ado here is the code. Its followed by some examples: > I for one think this is pretty sweet. I'm going to play with it and give you some feedback. I think this would definitely be a worthy project to flesh out more. Cheers- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732 --Apple-Mail-5-184054240--