Groovy
HTTPBuilder NG: Back From The Dead
I wanted to talk about HTTP Builder NG in this newsletter for several weeks now. @NoamTenne's talk at Greach gave me the final push. What is Http Builder NG?
Http Builder NG is a modern Groovy DSL for making HTTP requests. It requires Java 8 and a modern Groovy.
In particular, I like the concept that there are many client implementations ( (core-Java, Apache, OkHttp). Moreover, the deck shows many other powerful features.
Ersatz Server
In the previous link, you discovered a Groovy DSL for making HTTP requests. You will need to tests those networking calls. Ersatz Server, a library developed and mantained by @chrisstehno helps you out.
Ersatz Server is a "mock" HTTP server library for testing HTTP clients. It allows for server-side request/response expectations to be configured so that your client library can make real HTTP calls and get back real pre-configured responses rather than fake stubs.
GORM
GORM Data Services
My personal highlight of Greach. Data Services bring GORM to the next level:
Type Safety - Data service method signatures are compile time checked and compilation will fail if the types of any parameters don’t match up with properties in your domain class
Testing - Since Data Services are interfaces this makes them easy to test via Spock Mocks
Performance - The generated services are statically compiled and unlike competing technologies in the Java space no proxies are created so runtime performance doesn’t suffer
Transaction Management - Each method in a Data Service is wrapped in an appropriate transaction (a read-only transaction in the case of read operations) that can be easily overridden.
Building a Graph application with Grails and Neo4j
Last Monday, we published a Grails Guide about one of the coolest GORM implementations; Neo4j.
I encourage you to follow the guide. It is an easy read and you will get an understanding about what Graph databases are and you will see an example of GORM Data Services.
Grails
Criteria Builder vs. Where Queries
@sothmann shows you how to do pagination, ordering and projections with Where queries. This post is one of the few examples about projections with Where queries which I have found.
Where queries offer many advantages.
- DetachedCriteria
- Compile time type checked
- Compatible with static compilation
- Raw groovy for criteria
- Compose-able
Use them as much as possible!
Gradle
Gradle Plugin Workshop
This year, Greach had a workshop day. Normally, I am not a big workshop guy. Attending a workshop sometimes means passing several interesting talks. However, Greach organizers did several things right. They isolated the workshops into its own day, and the workshop lineup was impressive.
I wanted to learn how to write Gradle Plugins for a long time, and @ysb33r's workshop was an incredible opportunity.
This link points to the workshop exercises; a fantastic step by step Asciidoctor documentation to learn about how to code Gradle plugins.
Comment
Yesterday we said goodbye to Greach 2017. I attended my first Greach at November 2011. I got into the Grails world because of Greach. I started this newsletter after attending a Greach. This year, I did a talk, met some Groovy Calamari readers in person, learned a lot from many talks and workshops and got my excitement about Groovy and Grails future renewed. Conferences play an important role in the spread of a technology. My gratitude to Greach organizers. See you at Greach 2018!
Sergio del Amo