Ted Vinke's Blog

Java, technology and stuff

Grails Design Consideration #2 – Throw In a View Model Once In a While

This is my take on how we could design our particular user interface in such a way that they’re re-usable, testable and the overall software is more maintainable. Yip, using a bit of View Models from the MVVM pattern.


Recently we started working with two teams on a new Grails application.

As part of that I reviewed some code of the teams’ earlier applications to come to some general coding standards & conventions both teams would follow for the new application. In these code review sessions I’m also giving advice on some architectural choices and design style I would prefer.

Use Case: Tasks

The new application’s homepage displays the logged in user, a overview with tasks grouped by month and some unrelated sliders.

E.g. something like this:

Tasks and stuff

Continue reading “Grails Design Consideration #2 – Throw In a View Model Once In a While”

Grails Expert Tip #8 – There’s a Bean for That

grails-expert-tipRecently I code reviewed some of the Grails (2.4.5) code of another team (of course :-)) and here’s a snippet I came across.

In some “search helper service”:

 public int countListWithoutFetching(Collection collection) {
   def session = grails.util.Holders.grailsApplication.mainContext.sessionFactory.currentSession
   return ((Integer) session.createFilter(collection, "select count(*)" ).list().get(0)).intValue()

This team somehow needed some ‘generic’ way of counting the amount of records in the database, I thought.

Continue reading “Grails Expert Tip #8 – There’s a Bean for That”

2015 in review

The stats helper monkeys prepared a 2015 annual report for this blog.

Here’s an excerpt:

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 82,000 times in 2015. If it were an exhibit at the Louvre Museum, it would take about 4 days for that many people to see it.

Click here to see the complete report.

Here are the slides for the Web Application Development using Grails & Docker workshop recently given at Devoxx Belgium 2015.

Or view at SlideShare directly.


Blog at | The Baskerville Theme.

Up ↑


Get every new post delivered to your Inbox.

Join 166 other followers