A story of migration from JAXB 1.0 to 2.0
Today, I've heard from JAXB's internal customers that they had a successful transition from JAXB 1.0 to 2.0. It was from Rebecca Searls, who's working on the migration tool of Sun Java System Application Server 8. I'm not particularly familiar with what this tool does, but it's a tool that helps you to migrate from other vendor's app server to Sun's app server.
Such a migration involves in reading and converting vendor-specific deployment descriptors, which are mostly XML. So naturally they wanted to find a simple way to read/write XML, and hence JAXB. Here's what they found:
| JAXB 1.0 | JAXB 2.0 | |
| # of schema files | 62 | 62 |
| # of JAXB customization files | 14 | 7 |
| # of generated Java files | 8326 | 1084 |
| size of the compiled class files | 66407K | 3685K |
Notice the huge improvements in the footprint (66M->4M). It's partly because we no longer generate unmarshaller/marshaller/validator, it's partly because the spec team and the EG worked hard to reduce the number of classes we generate.
Rebecca also listed the following benefits:
- No more ObjectFactory.createXYZ. The problem with those factory methods was that they throw a checked JAXBException. Now you can simply do new XYZ(), no more try/catch blocks. (I know, I know, ... this is one of those "what were we thinking!?" things)
- Less customization files = less things to worry about.
- Login or register to post comments
- Printer-friendly version
- kohsuke's blog
- 1969 reads





