commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [betwixt] Writing Map entries issue
Date Thu, 03 Jun 2004 19:36:23 GMT
On 3 Jun 2004, at 14:00, Inger, Matthew wrote:

> Please send me what ideas you had.. Thanks.

there's actually already a patch for derived beans (but it can't be 
applied without breaking some other stuff). the older reading code on 
CVS HEAD isn't good enough to cope with derived beans (or several other 
cool tricks such as array valued maps). you need to use the REFACTORING 

with the new stuff, there are a number of ways to approach the problem. 
there are two basic routes that the solution can take: either adapt the 
existing BeanBindAction or create a new binding action 
(DerivedBindAction). i'd probably go down the BeanBindAction and add 
the derived bean functionality there.

the crucial design decision is working out how BeanBindAction should 
decide on which type is to be mapped. at the moment, this is fixed at 
introspection time (and so is the logical type of the class). at 
runtime, the runtime typing is determined by the BeanCreationChain. 
provided that the reflection still works, then everything works ok 
(this is how people map EJB's with betwixt.)

but, since the type is the logical type, any properties that the 
runtime type has in addition to those of the logical type will be 
ignored. so, they don't work properly.

provided that we're not losing anything by altering the type that's 
bound to from the logical type to the runtime type, it should just be a 
case of creating a new derived bean creator to the standard 
BeanCreationChain and changing the BeanBindAction so that the logical 
type is replaced by the actual replacement type. (i've now realized 
that i could probably have implemented this in the time that i've taken 
to explain it but in the long run, it's probably the right thing to 

the only probably i can think of is dynamic proxy's. i don't know what 
the effect of introspecting a dynamic proxy would be but this could 
probably be handled easily as a special case.

- robert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message