Grails
Instead of mapping with BigDecimal use the Grails Money Plugin
@xala3pa introduced in Greach the Grails Money Plugin. The idea is: instead of using a BigDecimal you use a class called Money which encapsulates the amount and currency. I've worked in the past with Grails web applications where I mapped money with a BigDecimal and I have been suffering the same problems as Alvaro explained through his talk (number format logic spread though the code base, rounding modes ...). You can use the Money class in your domain classes. It will map into two columns in your database.
Although the github repository lacks more documentation, he showed through the talk rounding capabilities, currency exchange, a taglib and other features.
His slides are worth reading because he zooms out and talks about the designs motivations. (Cohesion, encapsulation, primitive obsession, feature envy ...). I fall a lot of times in the primitive obsession trap.
We are going to map in the short term In-App Purchases in some of our domain classes and I will look forward to have the Money Plugin as my ally.
GORM Util
@burtbeckwith introduced a library called GORM-Util during his Greach talk. The library tackles one of my biggest pain in Grails developing:
When you turn on logSql = true the queries displayed use question marks instead of the supplied values and a myriad of aliases. It makes extremely painful and difficult to understand if the generated query is what you are looking for. The library assists in getting rid of the aliases clutter and replaces the question mark with values.
The library also contains a Many to Many Trait which will definitely appear in the near future in the Spring Security Core Plugin implemented by the UserRole class.
Gradle
Gradle Glam - Plugins Galore
I am a big fun of @aalmiray's talks. They normally cover a lot of ground and they introduce you always to cool parts of the ecosystem.
He goes through 16 plugins. Each of them interesting.
We were already using heavily the Shadow plugin which collapses all dependencies and project code into a single Jar file.
My co-worker @pmartenza has already included into the Shoptimix's android app the versions plugin. A plugin which provides a task to determine which dependencies have updates.
Another good one is the stats plugin which gives you a detail counting of lines of code for your project.
If you ever need to work with Licenses, checkout the License plugin
Libraries
Get for browser automation
I am very interested in Geb and @JacobAae's talk at Greach meet my expectations. In a very detailed presentation he presented Geb capabilities. Moreover, I specially like how he advocated the use of Modules and Pages.
Additionally I discovered a couple of configuration tricks to test the download of files. A really cool pause function and other tricks which I will definitely add to my tool belt.
Checkout the Github repo
Greach videos will take a month to be published. In the meanwhile we can watch a similar talk's video of @JacobAae at GR8Conf India.
Comment
Greach!
It was my fourth Greach and it was probably the best one for me. Around 150 attendees and a venue which was perfectly chosen for that amount of people. The talks were great and I've got content for several issues which I am looking forward to share with you. This is a small issue though, with four set of links which I could not wait to share. I hope to be back with more great content soon.
Groovy Calamari