page banner
avatar
'Groovy for Java developer: learning Groovy-specific features' post illustration
Groovy for Java developer: learning Groovy-specific features

Groovy is an object oriented dynamic language for the JVM. Dynamically compiled to a bytecode and interoperable with most Java libraries, Groovy is a perfect candidate for writing lightweight scripts that still can benefit from the Java ecosystem. Also, it is really easy to learn since the good old Java syntax is usually valid in Groovy. There are, however, a few caveats that you should be aware of before start coding. This post shows some specific features, and also gives a few suggestions which will help to write a clear, groovy-style code.

avatar
'Creating custom GSP tags and tag libraries in Grails' post illustration
Creating custom GSP tags and tag libraries in Grails

Grails tag libraries are designed to provide content formatting capabilities right on a GSP page. The 'tag' is an action that can be declared in a form of an HTML element. This action can accept an enclosed content and parameters defined as the element attributes to render a modified HTML. For instance, the following built-in tag iterates and renders each element of the list object using the template specified in the content:

avatar
'Grails Unit Testing: covering domain classes and services' post illustration
Grails Unit Testing: covering domain classes and services

Unit testing in Grails is currently implemented with Grails Testing plugin. The plugin provides unit testing facilities through the GrailsUnitTestCase class which offers a lot of useful methods for mocking Grails-specific objects. This post demonstrates how some of these methods can be used to test Grails domain classes and services.

avatar
'Synchronizing threads with Java locks' post illustration
Synchronizing threads with Java locks

Java locks often supersede synchronized blocks and methods by allowing to back out from the synchronization attempt. This post shows how to use the feature, and demonstrates some other basic concepts, like the lock fairness and reentrant locks, which should help you to get started with the lock-based synchronization.

avatar
'API Enhancements in Java SE 7' post illustration
API Enhancements in Java SE 7

Recently released Java 7 has a lot of useful API enhancements such as the automatic resource management, multi-catch statements, switch statement with strings, binary literals and improved numeric literals. This post is a quick roundup of the new features, which should help you to get a full picture of Java 7 syntax in a short time.