March, 2010

Rapid development with Lombok

Monday, March 15th, 2010

    Being an old NetBeans lover I’ve almost started feeling depressed second time for the last 10 days. My first disappointment was Spring Roo, which is going to be supported only by Eclipse – NetBeans and IntelliJ users are outboard.

Basically, the problem is that Spring Roo is heavily based on AspectJ, which is not fully supported by the both platforms. Roo followers may argue that the best IDE for Roo is the console app (with is really really good and well-developed by SpringSource team), but as a typical enterprise Java developer, I’m tied to Windows platform (which is a common corporate standard), so in the most cases I prefer to leverage the advantages of modern graphical IDEs.

    The second disappointmend could have become Project Lombok (that was highlighted on the last JavaPosse roundup). Founded by two enthusiasts, Project Lombok was integrated only with Eclipse until recently (though project contributors were actively looking for support in NetBeans and IntelliJ communities to help with making pligins for these IDEs). But in the last beta version, rich support for NetBeans was added.
    So what’s the idea behind Lombok. Simply putting lombok.jar to your classpath you can remove a lot of boilerplate code from your old Java classes. For example, @Data annotation allows you to make a kind of Scala’s case class of your bean.    
(more…)

LЮK, CherryWata @ Reactor Club, Minsk

Monday, March 8th, 2010

That was my first and last time shooting the whole concert with Canon’s 50mm prime. When you’re close to the stage, you can make only 1/2-portraits of the musicians (the angle is not wide enough). When you’re 2-3 steps away from the stage, the picture is filled up with heads, hands, and legs of fans. 50mm will help you in a very low lighting (depending on the situation), but can hardly be your general purpose lens for shooting concerts.
(more…)

Implementing Jersey REST-services in Scala

Thursday, March 4th, 2010



    In this article I’m going to continue exploring enterprisy (thanks JavaPosse#298 for this expression) development with Scala and sharing my experience with those Java developers, who slowly start to recognize power and usability of this beautiful language, combined with ability to stay in the comfort area of both known and new high-grade Java frameworks. Previously, I briefly described, how iBatis 3.0 framework can be used together with Scala in order to build a robust persistence layer. In what follows I will show, how easy it is to build REST endpoints with JAX-RS and SJSON library in Scala.

    Jersey is the free production-ready implementation of jsr-311. It’s one of the simplest JAX-RS frameworks to use due to POJO (and also POSO) support with a wide range of annotations, and a very small additional configuration to be done in web.xml (no web.xml alteration at all is required if you use Grizzly (Simple/lightweight) HTTP web server, but I’m going to deploy my services on Tomcat). SJSON is the library developed by Debasish Ghosh that allows users to serialize/deserialize Scala classes into JSON with a very small effort (literlly, 1-2 annotations per class).

(more…)