aspose file tools*
The moose likes Web Services and the fly likes xml databinding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "xml databinding" Watch "xml databinding" New topic
Author

xml databinding

adrien daolena
Greenhorn

Joined: Mar 05, 2012
Posts: 3
Hello,
I have some trouble finding a solution for the XML data binding for my project.
Here a little of context.
I have some XSDs given by an external company which cannot be modified.
I already have a domain model, which have a lot of concept in common with the xsd's but it is not structured the same way. Some attributes are not located in the type for example. I am not allowed to change the model.
Due to performance issue, I want to plug directly my own model to the XSDs model during XML generation using a mapping file for example.
moxy from eclipselink could answer the problem but it is not working properly on the current architecture. (still working on it)
JaxB is not powerful enough.
Any ideas?
Best regards
(I'm afraid my english got a little rusty, I hope it is clear enough)
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1020
    
    5

Would it not be easier and simpler to have a mapping layer between the objects generated from the XSDs and your domain model?

Check out dozer if you decide to go down this route:

http://dozer.sourceforge.net/
adrien daolena
Greenhorn

Joined: Mar 05, 2012
Posts: 3
Thanks for your reply, hum, actually the application I work on will have to handle dozens of thousands of requests per second and some data have a time to live lower than 1 second, so every byte / millisecond is good to take.
In this case I will have 2 models and a bindings layer, it might be too heavy.
But yes this is a valid option, I have considered it but if I can find a faster solution I'll take it .
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Would you care to elaborate further on the scenario?
Here is an article about an architecture that claims to be able to handle millions of orders per second: http://martinfowler.com/articles/lmax.html
If your current architecture is not right, the best XML data binding tool available will not help you - are you sure that the transferring of XML data to the domain model is the bottleneck in the current system?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
adrien daolena
Greenhorn

Joined: Mar 05, 2012
Posts: 3
Hi,
The project is not deployed. So I don't have a answer if it is a bottleneck or not. But if I have to try a guess I'll say no.
But keeping 2 distinct models in the application means that I will have the double of objects in memory, I want to avoid that.
Regards
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If the project is not deployed or haven't been load-tested yet, then it feels to me like premature optimization.
Experience tells me that this is seldom the most beneficial way to go.
If you suspect that XML marshaling and/or unmarshaling will become a bottleneck, then I suggest that you design the system as to make it easy to exchange this part and then use the XML databinding framework you are most comfortable with.
As soon as your system can be run, you load-test it to determine any bottlenecks. Only after load-testing, you start any optimizations.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xml databinding