On 7 Jan 2004, at 05:44, Niall Pemberton wrote:

My problem is I built a framework to just generate, process and spit out
DynaBeans and then got it to also do POJ beans afterwards when I discovered
your "Wrapped" DynaBeans .


1) WrapDynaClass.newInstance()
The framework generates DynaBeans (from Excel files). I am storing the
DynaClasses and using newInstance() to generate DynaBeans as it needs them.
It just made adapting my framework to generate ordinary JavaBeans via
"Wrapped" dynabeans v.easy with WrapDynaClass.newInstance() working the same
as other DynaClasses. I agree with you, if I hadn't built it initiallly just
for DynaBeans I could have done it differently.


Also if WrapDyanClass doesn't implement the newInstance() method then it
doesn't fulfill its contract as a DynaClass type - shouldn't it do it
anyway, even if there are other ways to generate the WrapDynaBean -
otherwise it has to be catered for as special case.

this seems like a reasonable use case. i'm in favour of adding this method (with some more documentation giving advice about the most typical use case). i'll probably go ahead and add this one unless sometime soonish.


2) WrapDynaBean.getInstance()
The framework runs out of the box to generate DynaBeans from Excel
spreadsheets using XML configuration. If I can get the original JavaBean out
of the Wrapper, I don't have to worry about modifying my existing framework.
I think this is a good use case - have a system where you can plug in a
Factory to generate whatever flavor of DynaBeans are required, process them
and then spit them out to a downstreams system (which has no reference to
those POJ Beans) which can then "UnWrap" them and use them as it likes.

being able to obtain a reference to the wrapped bean seems reasonable to me. again, this kind of thing is probably not appropriate for the most common use cases but would be useful for some kinds of design. i'll probably go ahead and add it (with some appropriate documentation) sometime soonish.


- robert


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to