Type class based serialization is now standard in Scala JSON libaries such as Play JSON. All our web applications these days are designed as JSON APIs, with the UI being just an API client. We usually find we want a few different serialization formats. Here are two examples that came up recently: logged-in users can see more information than anonymous users; and, as we’re using Mongo, we want a serialization format for the database that includes more information than other clients can see. Thus we need to control which type class is used for serialization at each point.
the UK's leading Scala consultancy
Underscore is a team of expert Scala consultants, trainers, and developers, based in London, UK.
What we're saying
The web applications I’ve been involved with over the last year or two have tended towards being richer, with more real-time interactions, and more collaboration. The mechanics of building collaborative applications aren’t so tough, but eventually you run into the problem of what to do with text. But good news: there are some smart algorithms to help you out, which you can implement in a couple of hundred lines of code.