This is a confusing area, and I'll try to clarify the issues in the 1.0 documentation. The extends="..." attribute on a binding was designed to support the equivalent of schema substitution groups with a matching hierarchy of Java classes. Because of the way it was implemented it's limited to a single level of inheritance in the 1.0 code. The abstract="true" was originally just an indicator that this type of runtime substitution (with different element names for the derived classes) was going to be used.

Since then (especially in the current CVS code) I've extended the meaning of abstract="true" to allow mappings to be used as the equivalent of schema types, where you define the structure of the class representation once but can use it repeatedly with different element names (or can embed it directly within the structure of a derived class representation, something that has no schema equivalent).

 - Dennis

babloosony wrote:

Hi All,

I have some doubts on extension mappings.

Say I have below binding.xml taken from JiBX tutorials:

<binding>
 <mapping class="example10.Identity" abstract="true">
   <value name="cust-num" field="customerNumber"/>
 </mapping>
 <mapping name="person" class="example10.Person">
   <structure map-as="example10.Identity"/>
   <value name="first-name" field="firstName"/>
   <value name="last-name" field="lastName"/>
 </mapping>
 <mapping name="company" class="example10.Company"
extends="example10.Identity">
   <value name="name" field="name"/>
   <value name="tax-id" field="taxId"/>
   <structure map-as="example10.Identity"/>
 </mapping>
 <mapping name="customer" class="example10.Customer">
   <structure field="identity"/>
   <value name="street" field="street" usage="optional"/>
   <value name="city" field="city" usage="optional"/>
   <value name="state" field="state" usage="optional"/>
   <value name="zip" field="zip" usage="optional"/>
   <value name="phone" field="phone" usage="optional"/>
 </mapping>
</binding>


Now, both example10.Person and example10.Company extend their parent class example10.Identity and for person mapping I didnt use any extends attribute and for company mapping I used extends attribute. My doubt is I dont find any difference in the final xml created by this type of mappings. So what exactly extends attribute make difference in the final xml that we try to make ? Please suggest ?



Thanks & Regards,
Kumar.


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ jibx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-users





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to