Jon Richards wrote:
> Hi all.
> I was playing with JAXB2.0 yesterday and the team and me are really
> pleased with the results. Everything is much tidier. No more impls and
> runtime stuff, and not having to extend the impl classes which always
> seemed 'wrong'.
>
> Best of all for us is ObjectFactory not throwing JAXB exceptions on
> object creation and the fact the you can statically import the inner
> classes. No more createThisThatTheOtherInHereOutThere...
Cool. Hearing that you are happy makes us happier.
> Some questions though if you don't mind:
>
> I've always tried to use the ObjectFactory in case future versions sneak
> some code into the createX methods, however i'd rather just new the
> classes my self. Is this allowed? Discouraged? Don't care?
I'd say it's encouraged.
IMO the use of the factory in 2.0 is:
1) for creating those JAXBElement with proper QNames and type names
2) for having unmarshaller create your sub-classes during
unmarshalling.
> Secondly is JAXB2.0 any faster? Do you have any metrics? It would be
> nice to report that JAXB2.0 is x times faster than previous versions. I
> appreciate it may well not be faster. Just curious...
I reimplemented marshaller, and with our internal benchmark it's a lot
faster now --- 1.5 to 3 times faster, depending on the size of your
document.
The unmarshaller hasn't really changed. That's something I'd like to
work on in the future, hopefully during this summer, before the release
version.
You can look at the bindmark project for a 3rd party benchmark, although
it doesn't show the marshaller improvements we are seeing internally. We
are talking to the author of the bindmark project to find out why.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com