From: Tom Sawyer Date: 2002-08-28T17:41:58+09:00 Subject: Re: Distributed Object Container On Wed, 2002-08-28 at 02:04, Philipp Meier wrote: > I recently stumbled over OJB (http://jakarta.apache.org/ojb/) which is a > object relational bridge including a ODMG 3.0 complient API. Although I > didn't tried it yet I think something like that is missing for ruby. Of > course, the API must be ruby like. The concept of blocks in ruby would > be great for transaction demarkation (sic?), e.g. I imagine writing db > access or generally access to persistent object like this: > > def add_item_to_cart(item_ids) > transaction.serializable do > @warehouse.queryByValue(:id, item_ids) do |item| > item.instock -= 1 > @cart[@item] += 1 > end > end > end while your example is bit more then i have yet provided, if your are interested in being able to move you objects in and out of a database with minimal fuss, i have created DBize (soon to be released as well) it is primarily a mixin module that makes an object instantly "relationable". it also provides for subrecords (i.e. many-to-one table relationships). ~transami