Hi,

My service accepts both XML and JSON representations.  Obviously the
business logic should be implemented once, so I need to pick a canonical
representation.  My options seem to be:

1.  XML

There are great tools for working with XML.  I'd update the business
layer objects using either XPath or SAX events.  JSON representations
would be converted into XML for processing. 

2.  POJO

Deserialize representation into POJOs, directly from JSON or XML as
appropriate.  This avoids working with XML directly, but requires an
extra data model (the legacy business layer uses POJOs annotated for
Hibernate, but I want to decouple the REST layer from the business
layer, so I'd have to duplicate the data model to some extent)

I'd love to hear about what has worked and what hasn't worked from those
who have gone before.

Best regards

Richard Hoberman

Reply via email to