Erik Beeson a écrit :
[...]
We use XStream to do all of our serialization, so we get to switch between
XML and JSON for free, which is really nice. Our containers end up really
cluttered with a lot of XStream related annotations (mainly @XStreamAlias
and @XStreamImplicit), so separating them helps keep the data POJOs much
cleaner.

interesting for the input/validation, thanks for the tip!

for output needs I needed to be able to let the end-user client be in charge of the output he wants for its own usage, so I'm now considering templating solution where the Rest server handle the request, build a business context (mainly a list of hased POJO) and then use a template name either implied by the client signature, or provided in the request URI to choose from.

So for example I could provide an XML tailored for each client, letting the end-user choose
the format he wants to eat.

one other option I didn't yet fully investigated is letting this templating be done on the client side, where the context for the template engine is provided by the REST payload

(have a look here : http://www.kuwata-lab.com/tenjin/ where you see that you can get in javascript
more speed than velocity).



Reply via email to