Home » Author Archives: Alex Staveley

Author Archives: Alex Staveley

Agile Databases

software-development-2-logo

Any project following an Agile methodology will usually find itself releasing to production at least 15 – 20 times per year. Even if only half of these releases involve database changes, that’s 10 changes to production databases so you need a good lean process to ensure you get a good paper trail but at the same time you don’t want ...

Read More »

Requirements in an Agile World

agile-logo

On a recent project, there was a pain point where Stories with unclear requirements were ending up with developers. Time was then spent trying to clarify the missing pieces meaning less time to write great code and meaning that developers ended up under even more pressure to get things done. Now, there are many reasons why Development teams struggle to ...

Read More »

Custom User types in GORM

grails-logo

Recently, I wanted to model a Merchant which like many things in a domain model had an Address. I thought it made sense that the Address was embedded inside the Merchant. Reasons: It had no lifecycle outside the Merchant. Merchant dies so should the address. It only ever belonged to one and only one Merchant So pretty obvious this was ...

Read More »

Postgres indexes

postgresql-logo

Recently, I had a situation where I needed to think how I was using Postgres indexes. I had a simple Book table with the following schema… >\d book Table "shopping.book" Column | Type | Modifiers ---------------------+------------------------+----------- id | uuid | not null version | bigint | not null amount_minor_units | integer | not null currency | character varying(255) | not ...

Read More »

Problems with Cobertura and Sonar 5.1

sonar-logo

Recently, I was having some bother trying to use Sonar 5.1 with my Grails 2.4.4 project. I was using the usual Groovy stuff:Gmetrics, Codenarc and Cobertura. For the Sonar database I was using Postgres 9.4. The logfile for the Sonar runner just gave me this: build 22-Jun-2015 07:44:30 INFO: ------------------------------------------------------------------------ build 22-Jun-2015 07:44:30 INFO: EXECUTION FAILURE build 22-Jun-2015 07:44:30 INFO: ...

Read More »

Using separate Postgres Schemas for the same database in a Grails App

grails-logo

Recently, I wanted to use the same Postgres Database but split my persistence layer into separate components which used separate schemas. The motivation was to promote modular design, separate concerns and stop developers tripping up over each other. Vertical domain models can be difficult to achieve but not impossible. In my shopping application, I had a user component, a shopping ...

Read More »

MongoDB and Grails

groovy-logo

So recently, I had a requirement to store unstructured JSON data that was coming back from a web service. The web service was returning back various soccer teams from around the world. Amongst the data contained in most of the soccer teams was a list of soccer players, who were part of the team. Some of the teams had 12 ...

Read More »

Grails tip: refactoring your URLs

grails-logo

On the current project I am working we use a lot of integration tests. For you non-Grails users out there, Integration tests test your Controller APIs, your Services and any persistence that might happen all very neatly. The only slice of the cake they don’t test from a back end perspective are your Grails filters for which you’d need something ...

Read More »

Groovy Closures: this, owner, delegate let’s make a DSL

groovy-logo

Groovy closures are super cool. To fully understand them, I think it’s really important to understand the meaning of this, owner and delegate. In general: this: refers to the instance of the class that the closure was defined in. owner: is the same as this, unless the closure was defined inside another closure in which case the owner refers to ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials