commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [betwixt] Mapping for interface instead of class
Date Thu, 28 Aug 2003 21:25:59 GMT
hi martin

(good to hear from you again)

i've finally managed to get things moving again.

i've refactored the reading code so that the object creation is now 
delegated to a chain of bean creators. so, as well as being able to add a 
'class' attribute to the .betwixt file it is possible to progammatic hook 
new implementations into the chain or even replace the chain completely.

this will allow some really cool stuff like object pools (which i hope to 
use later for scarab).

i've been thinking for a while about the best design for reading and i 
think that my next move is to convert the rule set to be a single rule 
that takes all elements under the root (that the bean is mapped to) and 
then users an internal state to work out what to do. i might post up some 
design documents about this if people are around and interested.

once this is done i want to start look at object pipelines. this means 
creating an callback API which will allow a stream of objects to be 
created by betwixt and then processed. i think that by combining this with 
object pooling, we might be able to scale betwixt to where scarab needs it 
to be. (100,000+ base elements.)

- robert

On Wednesday, August 27, 2003, at 02:58 PM, Martin van den Bemt wrote:

> Creating beans from that will however still not work.
> If you have Interface I and class A and B implementing I, betwixt cannot
> figure out which class it was, unless we are actually putting the
> getClass().getName() into the xml now (please forgive me not looking at
> the code to check this), for the objects the be correctly recreated from
> xml..
>
> Mvgr,
> Martin
>
>>>
>>> Please keep in mind that betwixt cannot recreate the beans if they are
>>> based on an interface. (new Interface() just doesn't work :) ).
>>
>> this is exactly what robert fixed/implemented last week.  check the
>> betwixt page and look at advanced reading.  there is now a 'class'
>> attribute in the <element> in the .betwixt file.  i just tried it last
>> night and it works fine.  makes it so that you can map an interface at
>> read-time to a concrete class that implements it.
>>
>> cheers,
>> gary.
> --
> Martin van den Bemt <mllist@mvdb.net>
> mvdb.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


Mime
View raw message