So as you may have seen in my last few posts. I spent most of the weekend creating my first grails plugin. My lovely wife is away for 3 weeks on holiday so I am blasting out all the little projects that I have wanted to do.
So I thought I would just write a little piece about my experience of writing the plugin. First thing i would like to say is what a pleasure it was to write and as how easy it was. So how did it come about.
So things i found hard to do and never really managed to do it in a nice way was to mock out the grailsattributes object and grails application etc. My tag needs these to get access to domain and command objects but it is very complicated to mock them out.
Eating your own dog food.
So before i actually realeased the plugin i installed it in my own application and started using it in a real app. This turned out to be essential for testing. I found several issues that it did not handle. Things like: grails auto generating nullable constraints for all attributes of a domain class but not for command objects was tricky as you ended up with unecessary validation generated. So after a few rounds of tuning and robusting i realesed it.
Grails plugin release process.
It is so easy to release and re-release a grails plugin that you have to create one just to see that work. Auto tagging and versioning is handled so smoothly. But i guess i would not expect anything less from grails.
So to conclude if you have any greate ideas for a plugin then build them. There is nothing stopping you.
Remember someone once said that the saddest words of tongue or pen are these: "it might have been".
Ps. Version 0.4 is out now :)