commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary S. Cuozzo" <>
Subject Re: [betwixt] Mapping for interface instead of class
Date Wed, 27 Aug 2003 12:27:23 GMT
On Wed, 2003-08-27 at 05:36, Martin van den Bemt wrote:
> Hi Christoph,
> As far as I can tell (been working on other things for a while now), it
> will be a lot of work 
> There are afaik a couple of  options :
> 1) Create a betwixt file for the interface and copy and paste it for
> every bean that you have, so the only thing streamed to xml is interface
> compatible.
> 2) Add all the beans to a collection and an appropiate adder (eg
> getEJBBeans() and addEJBBean(Interface), which I think should just use
> the interface when making xml out of the beans.
> 3) Dive into the internals of betwixt and do the introspection yourself
> (pretty bad solution I think).
> You have to test 2, since I don't know for sure if that is working or
> not.
> 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.


Gary S. Cuozzo <>
Innovation Software Group, LLC

View raw message