Meaningless Drivel is fun!
The moose likes XML and Related Technologies and the fly likes JAXB objects to Transfer objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXB objects to Transfer objects" Watch "JAXB objects to Transfer objects" New topic

JAXB objects to Transfer objects

Jim Janssens
Ranch Hand

Joined: Sep 24, 2004
Posts: 210
In our project we have several services (ejb's) which can be invoked using XML. The story is like this:

[external client]--xml--[jaxb]--jaxb objects--[converter]---domain objects---[service]

[internal client]--domain objects---[service]

Thus, every service has its own domain objects. These objects are simple java beans (get/set) which describe the input fields to execute the service. We need this layer of independence because the service can also be called from inside.

So, the classes that jaxb generates to convert the XML to java need to be converter again to the domain objects. So the converter does basicly this:


For simple examples this may not seem a problem, but for comlex XML it becomes very error phrone to write such converter. It takes a long time to write it, test cases take even longer...

I feel like this conversion must be done automatically. Something like saying to JAXB to use our domain objects and not te generated ones...

Any one an idea ?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Why do you need both at all?

I agree. Here's the link:
subject: JAXB objects to Transfer objects
It's not a secret anymore!