Post date: Jun 20, 2014 7:4:49 AM
Working on a small web-app and thought I'd try out Grails.
Note: Started with the 2.4.0 build, but there were issues with dynamic scaffolding (to be fixed in the next release) so reverted to 2.3.9.
The Database interface is great! Create a Domain Object that contains the fields you are interested in and viola, it's done; however I am still only using the built in hsqldb. It will be interesting to see how easy it is to migrate to a disk based DB like postgresql. In theory it should be straight forward...
Testing the Domain Objects is really straight forward. The use of Spock is great, making the unit tests really easy to write and read.
Note: I had a lot of trouble with 'blank' constraints. They just don't work from within a unit tests! All unit tests that use blank constraints fail with nullable. This seems to be a known problem, but a bit annoying.
Dynamic Scaffolding: After a controller has been configured to use dynamic scaffolding, a dynamic Web interface is created for your Domain Objects, changing and adapting it as you change your Domain Objects.
Creating Static Scaffolding: Once the domain objects are developed and tested, creating a standard set of controllers and views needs just a couple of 'generate' commands. This essentially copies the dynamic scaffolding code into your project.
Note: If the Domain Objects need to be changed, the static scaffolding wont reflect these changes and re-generating the static scaffolding will overwrite any changes you made to them.
Modifying the Scaffolding files: Though more complicated to develop, installing the scaffolding templates allows you to continue using dynamic scaffolding up until you are ready to release; at which point you can generate the static scaffolding.
Note: This is not for the fainthearted, but it is a very powerful development model!