Here is my test schema:

        <element name="A1" type="A1Type"/>
        <complexType name="A1Type">
                <sequence>
                        <element name="a1_str1" type="string"/>
                        <element name="a1_str2" type="string"/>
                </sequence>
        </complexType>
        
        <element name="Container" type="ContainerType"/>
        <complexType name="ContainerType">
                <sequence>
                        <element ref="A1"/>
                        <element name="c_str" type="string"/>
                </sequence>
        </complexType>

        <element name="A2" type="A2Type"/>
        <complexType name="A2Type">
                <complexContent>
                        <extension base="A1Type">
                                <sequence>
                                        <element name="a2_str" type="string"/>
                                </sequence>
                        </extension>
                </complexContent>
        </complexType>


Given that "Container" contains an "A1", and given that "A2" is an
extension of "A1", I believe I should be able to assign instances of
"A2" whenever "A1" is expected.

This isn't possible, however, with the class hierarchy generated. In
Java, "A1" extends "A1Type", and "A2" extends "A2Type" which extends
"A1Type". The problem is, "Container.setA1()" accepts an instance of A1,
rather than an instance of A1Type.

That doesn't seem intuitive to me. Is there something I'm missing?
Container.setA1() should really be accepting an A1Type, not an A1. 

Thank you in advance... Castor really is a stellar framework.

Bryan

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to