Hello-

I havent actually used ColdSpring yet but I saw that it had a nifty object,
"AutoWire" which conveniently populates an object (bean) via its setters
using a struct and its keys as "input". I ripped this out and implemented it
in my own code. However, as soon as I tried to populate a Bean which
"extends" another Bean (and has no functions of its own, e.g. they all exist
in the Base bean class), my method failed. This is because if a bean extends
another bean, and if you look at the result of getMetaData(), then all of
its functions are in the sub-struct "extends". To support an arbitrary level
of extends and all types of objects, I modified the method to use recursion,
that is, it recurses down the meta-data struct looking for all "extends"
keys and then "functions" keys and does its thing. My testing shows that it
works great.

Two questions:
1) Did I just re-invent the wheel? In looking at ColdSpring 0.5.0, AutoWire
doesnt support beans which are not base beans. Is this logic somewhere else
in the framework and I just missed it and did work for no reason?
2) If it doesnt exist, would ColdSpring benefit from me donating this code
back to the community? Do you care or even want this?

Thanks
/Cody Caughlan



Reply via email to