>
> > We use XStream to do all of our serialization, so we get to switch
> > between XML and JSON for free, which is really nice.
> I've been considering XStream so it's great to hear that it's working
> for you, especially regarding JSON.


Yep, very happy. Joe Walnes has done a lot of great stuff, and Google was
very wise to hire him up. XStream gives you all the right entry points to be
able to tweak it in just about any direction that you need.


> > annotations (mainly @XStreamAlias and @XStreamImplicit), so separating
> > them helps keep the data POJOs much cleaner.
> >
> > Our containers end up really cluttered with a lot of XStream related
> This is why I've never been that keen on annotations.  Keeping this
> information external to the POJO would leave them suitable for use in a
> client API as Vincent suggests.


I really like annotations as I got pretty burned out on "XML sit ups" in
Java web frameworks back in the day, but I see how it could be helpful for
you to decouple that information. Most things (XStream and OVal at least)
offer annotation support as an addon, so you can still provide your
configuration however you want.

How are you handling circular references/normalization in JSON?  My
> prototype uses flat structures and uses the business keys to resolve
> references on the client-side (javascript).  But I've noted techniques
> for serializing denormalized/circular JSON  (e.g.
> http://www.jspon.org/#JSPON%20Core%20Spec).  Have you formed a view?


I'm not as my data isn't structured that way. The most we have in terms of
relationships is parent/child, and we don't have situations where the
relationships get modified, so this hasn't really come up. For example, we
have Users which have Entries which have Comments. Comments don't move
between entries, and entries don't move between users, so our updates are
generally just modifying properties of a single object.

--Erik

Reply via email to