users@jaxb.java.net

Re: Applicability of JAXB

From: Nick Duan <nick.duan_at_TRW.COM>
Date: Mon, 27 Jan 2003 08:43:06 -0700

Thanks a lot Bryan for the detailed explanation, especially for the insight of your JAXB apps. I can understand your points, but I still don't think the following statement is really true:

>Your schema may change, but your domain model will probably remain fairly
>static. In this scenario, when the schema changes you'll generate a new
>entity model and make the relevant changes in your domain model to access
>it. This could be as simple as changing a single attribute name. If you
>were using DOM or SAX then you'd have to change a lot more, write tests for
>it, run the tests, fix the implementation, run the tests again, refactor,
>etc.

Suppose you make a small change to your existing schema, for instance, adding a new field called manufacturer to the Item type of po.xsd (SampleApp1 of JAXB RI distribution), and creating a corresponding po.xml with the manufacturer field populated. Suppose your existing application's domain model does not change (as you stated the domain model remains fairly static), so you don't need to access the manufacturer field in your app at all. If you were using SAX/DOM to access XML data, there is no need to change anything in your app at all. But if you were using JAXB and didn't regenerate everything and change your code, you get the UnmarshallException.

Thanks.

ND