Groovy
Groovy AST Transformations
@paulk_assert talks AST transforms. First he compares run-time meta-programming vs compile-time meta-programming. Later he talks about how to tailor predefined AST transforms with the use of their parameters. And probably the most important take away is that you can highlight your business logic by replacing common design patterns boilerplate code with by AST transforms.
Learn about @ToString, @EqualsAndHashCode, @MapConstructor, @TupleConstructor, @Canonical, @Lazy, @InheritConstructors, @Sortable, @Builder, @Delegate, @Memoized, @TailRecursive, @Inmutable ...
Functional Programming Kata with Groovy
@jshickey guides us through a Groovy exercise using a functional programming style. He praises the benefits of pure functions; data in, data out, no state or member variables mutation. These functions are easier to test, maintain, enhance and comprehend. Moreover, he warns us about for- and each{}_ statements, a smell of non functional programming code.
I learned about another cool Groovy operator, transponse.
Groovy Unmarshalling JSON to a Specific Object
One of the reasons why groovy is such a great scripting tool is due to the simplicity to read and generate JSON. This @Java_With_Ravi's post remind us that.
1 minute read.
Using Groovy Based Spring Configuration
@tim273 shows that Groovy allows for a concise syntax, nicer looking and extensible configuration files for projects using Spring 4 and above.
Whenever I see Groovy being used by for configuration, I think about Grails 3 application.yml file ๐
Grails
Grails Quickcast: Grails 3 Interceptors
OCI has partnered with DZone to launch a Grails Quickcast series! They just released the first video and it is great introduction to Grails 3 Interceptors by @jeffscottbrown.
You will learn:
- Why Interceptors are @CompileStatic Friendly and why it is important.
- Why you don't need to implement the Interceptor Trait.
- How to configure your interceptor with match
- How to "intercept" the request in different points (before, after, and after view)
- How to use use the boolean return statement to interrupt the flow.
20 minute video.
Thereโs a Bean for That
@tvinke remind us to inject beans, don't look them app.
In my development career, I got a bit of distance from the Java world just by the time were Spring got really popular so any post which deals with Spring Beans or injection is always helpful to me.
Comment
Big news of course is Grails 3.1 release ๐
Before you start to create your own company application profiles, use the Angular JS profile or get crazy with json views, check out these links to learn some Groovy tricks
Groovy Calamari