Grails Bug?

I just spent a couple hours trying to figure out why my Grails views wouldn’t match up with my domain.

This started out when I decided that I wanted to simplify my domain model and remove an item, DependencyVersion, from the middle of the hierarchy. This required the removal of the domain object and the update of higher and lower levels to fill in the gap. I am still in the early phases and haven’t started customizing my views much so the easiest thing to do (for me at least since I am a newbie to Grails – there may be a better way – speak up gurus) was to blow away the domain object, the test object, all the controllers, and all the views. I then ran my script, that simply called “grails generate-all X” for each domain object in my project, and generated new views.  I then started my server, only to be greeted by a message trickling up from Hibernate regarding the DependencyVersion class being missing but being used in an association.

My domain no longer had this class. I could even do a text search on the entire project for “DependencyVersion” and get no results. I tried everything I could think of – I won’t list it all here – but finally found out that the actual bug was resulting from grails caching the build and not updating it properly. When you run “grails generate-all X” it builds the domain classes and places them in the Documents and Settings folder. In my case, this resulted in my project being built here: C:\Documents and Settings\jmcdonald\.grails\1.0-RC4\projects.

I blew this folder away, ran my script again, and Voila!, it worked.  So am I missing something or is this a bug in Grails? I am very new to Grails and am thinking there is probably an explanation…

My Graduation Gift

This is my graduation gift to myself. It is a Junior Emperor Pen made out of Walnut Burl. I have wanted to make a high end pen for a while now and this was the perfect opportunity. I get a nice graduation “gift” and a chance to test the waters on the high end supplies. It is kind of hard to see, as I am still working on getting my photography skills as good as my turning skills, but the top, bottom, middle band, and clip are all engraved with designs. There are plusses/crosses on the middle band, a series of shapes on the top and bottom bands. The top/bottom of each end is engraved as well. You can see a much better picture of the actual pen hardware here.

This one is mine but if you are interested in a pen for yourself, contact me. This exact pen would run in the neighborhood of $80-$100 for roller ball (shown) and $100-$120 for fountain, however I have pens that start as low as $25-$30. Price ranges will fluctuate depending on how cheap I can get supplies.

Contact me for a free quote if you are interested in a hand crafted wooden pen for yourself.

Method Names

Quick, what does this method do:

isSupressMultiLanguage()

If you guessed that it determines if multi-language is turned on or off you’d be correct.

Quick, what does this method do:

isMultiLanguageSupressed()

If you guessed that it is does the same thing, you’d be correct.

The point of this is that each is readable. One may flow off the tongue slightly easier than the other, however both are perfectly legitimate verbiages for the underlying flag. Both point directly to the intent of the method and give a clear picture of what its purpose is.

So what is the opportunity cost? Zero. From a development standpoint it is pretty clear that these mean the same thing and a developer can get a feel for what each method does at a glance. As long as a developer can tell what a method does from just the name, the actual naming of the method is just a matter of personal preference.