Thursday 5 November 2009

XStream : The Simplest XML serializer

Serializing XML to (Java) objects and back just became simpler with what is being touted as the fastest and the simplest XML serializer, XStream.

According to this bench marking excercise, XStream is the fastest Serializer to hit our Java objects. While marshalling and unmarshalling is a time consuming task, using XStream would definitely be a performance boost. But while speed and its low memory foot print are talking points, it is simply easy to use. The XStream two minute tutorial takes TWO MINUTES to read and digest. The only slightly disconcerting aspect is that releases are few and far apart.

One a final note, if you are looking for an XML serializer that serialises with no hang ups, XStream might fit the bill but be aware that using XStream is like traveling in the economy class of a budget airline and while you might get home, you cannot expect too many features. For features, pick up JaxB 2.1 or XMLBeans.