Wednesday, July 13, 2016

Dependency injection with Guice in Play

Guice is the default dependency injection (further DI) framework of Play. Other frameworks may be used as well, but using Guice makes development efforts easier, since Play takes care for things under the veil.
The official Play DI manual does not provide sufficient explanation. This post is the first in the sequence of posts, explaining in the different way and in more details, how DI with Guice should be done.

Saturday, July 2, 2016

Customizing JSON mapping in Play

Play implements JSON conversion on base of Jackson. Play's static API Json should be used for operating Json data.
For example:
// Convert from JSON:
MyClass person = Json.fromJson(json, MyClass.class);
// Convert back to JSON:
JsonNode jsonNode = Json.toJson(person);
The default JSON mapping may be changed by providing configuration to Jackon ObjectMapper.

About the author

My Photo
I trust only simple code and believe that code should be handsome. This is not a matter of technology, but professional approach, consolidated after years of software development. I enjoy to cause things working and feel very happy, when I manage to solve a problem.
Back to Top