hi holgar

thanks very much for the test cases

On Wed, 2006-05-24 at 08:15 +0000, Holger Haag (JIRA) wrote:
> Bug/Testcase: Reading does not work: Container holding a list (generics) of 
> interface implementations
> -----------------------------------------------------------------------------------------------------
> 
>          Key: BETWIXT-52
>          URL: http://issues.apache.org/jira/browse/BETWIXT-52
>      Project: Commons Betwixt
>         Type: Bug

i've been taking a look at this tonight. bit tricky so i probably will
not have a solution completed tonight. 

the first problem is that the xml to be mapped to. the formulation is:

[1]    <AlphaListHolder>
               <AlphaList>
                   <one>1</one>
               </AlphaList>
               <AlphaList>
                   <two>2</two>
               </AlphaList>
        </AlphaListHolder>

this makes things very difficult. betwixt only supports polymorphic
mappings with different names. this means mapping as a mixed collection
which would be something like:

[2]     <AlphaListHolder>
               <AlphaOneImpl>
                   <one>1</one>
               </AlphaOneImpl>
               <AlphaTwoImpl>
                   <two>2</two>
               </AlphaTwoImpl>
        </AlphaListHolder>

would this be acceptable?

the second problem is that betwixt doesn't support List based properties
very well ATM. really, a list backed property should act in the same way
as a getter-added bean. a few changes will likely be needed before this
works correctly.

a final issue is that it's hard to guess context without a wrapping
element. 

[3]     <AlphaListHolder>
                <AlphaList>
                  <AlphaOneImpl>
                     <one>1</one>
                  </AlphaOneImpl>
                  <AlphaTwoImpl>
                      <two>2</two>
                   </AlphaTwoImpl>
                </AlphaList>
        </AlphaListHolder>

seems a more natural mapping to me for your object structure. 

if not then there are other ways that polymorphism could be extended. 

- robert



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

Reply via email to