Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml databinding

 
adrien daolena
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
adrien daolena
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic