Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs

Thursday, July 7, 2011

Grails - Plugin - Uber Scaffolding

Grails - Plugin - Uber Scaffolding

When trying to iteratively develop applications, it is typical that your domain model changes a lot during early parts of development. Scaffolding is a great crutch to develop CRUD pages, and in fact the scaffolding process can be extended to add additional pages beyond the regular CRUD provided out of the box. Furthermore, Grails' capability to do dynamic scaffolding is a great way to test your domain model, and frequently can serve as basis for future work on GSP pages.

However, the default scaffolding templates are limiting in that they don't allow customizations of scaffolded pages. For example, if I want to NOT display a particular property on the show page, I am not able to do so - I have to generate the scaffolded GSP pages, and then manually edit them. This means that if I need to add another property in the future, I have to either start manually edit the GSP pages, or regenerated scaffolded pages, and remove the unwanted property. This seems to violate DRY.

Additionally, some plugins require modifying the GSP pages. For example, the drill-down plugin requires to add tag to the header element, as well as other elements into the list table. Our plugin had to provide ability to insert some of those customization so that we can insert plugin integration code into our scaffolded pages.

I wanted solutions to the problems above, and wanted to see how far I can push the dynamic scaffolding process in that my UI layer is absolutely minimal. There will definitely be time for custom UI development, but I wanted to generate as much of the UI as possible.

No comments:

Post a Comment