[Nitro] Og::Store (was Re: og regarding legacy apps table hints)

Deborah Hooker deb at ysabel.org
Fri Aug 19 04:12:54 EDT 2005


George Moschovitis wrote:
> Another thing that 'bothers' me is the cloning of the property
> metadata into structured_fields. Can we avoid that?

PLEASE.  *grin*

The biggest thing in my wishlist right now is that property metadata alone
isn't reliable for building tables and the like.  I wrote a set of "unit
tests" to explain what behaviour I really need (and am having to emulate by
walking the properties metadata multiple times to sort out what the user
really intended).  They're in WISHLIST.

I think, given your comment onlist earlier about annotating attributes
that're just created with attr_accessor and its ilk, that this should be
pretty easy to get to.

The big thing that causes pain at the moment is that properties copy
themselves down onto subclasses, which means that if you then dynamically
add a property to a class, its information doesn't get propagated correctly.
 The other biggie is that you can't tell where something was declared, so
you can't sort out where it belongs without comparing properties on a class
to its parent's properties...which may or may not have everything because
something might've been added along the way!

If we can get properties to be reliable and complete, we can drop nearly all
of the need to walk/collect property metadata, and fields can really just be
specific to dealing with persisting the properties.

On the bright side, if you look at what this collection of code needs out of
properties (and can't get right now, and thus has to do "on top of" them), I
suspect you'll have a pretty complete set of use cases for property
metadata...  I _think_ the "tests" listed in my WISHLIST file actually cover
pretty much everything I needed in a very concise way, and it's not that
much.  Though I didn't specifically write a test to express the idea that
adding a property dynamically doesn't violate any of the tests, and you'd
want something like that for a real set of tests.

(That, and the "meta"/"metadata" thing, which drove me up the wall until I
got it sorted out far enough that I stopped trying to access <class>.meta
all the time.)

-- 
[ deb at ysabel.org ]          - Ysabel -          [ http://www.ysabel.org/ ]



More information about the Nitro-general mailing list