X + Y = WTF? Stupid Web 2.0 mashups
For reasons of vested interests I was drawn to Hani’s bile blog covering the first day of JavaOne.
Amongst the typical and sometimes amusing negativity, Hani does rightfully bemoan the phenomena of pointless Web 2.0 mashups. The problem here is that for a lot of listeners/readers such mashups are their business, so the market exists for them and for many these demos make sense.
From a personal point of view however, I tend to agree with Hani about the suckiness of such pointless conflagrations of services that individually are useful but together make you scratch your head. I call this "X + Y = WTF?" because it makes the childish side of me laugh.
The trouble is that in a short space of time you want to demonstrate something that is both functionally impressive while showing how easy it is to produce. If all the amazing apps in the world can be created while talking to an audience in under 1 hour then why are we sitting down reading about better ways to do things?
The bottom line is talks are about impact, and you have to lean on the side of showing what the tools can do rather than outlining explicitly the shape of the applications people can produce with this stuff.
One of the best demos for technology like Grails so far has been Glen Smith’s groovy blogs site. That took 20 hours, and most people consider that to be amazing. Is anyone going to sit in a room for over 20 hours to experience this amazing demo being made?
I really know why Windows sucks now
In the immortal words of Strapping Young Lad, "Oh my f**king god". I’m cleaning out an old PC to donate to a friend – since moving to Mac I even feel bad giving PCs away to people – and am rediscovering Windows XP.
One of my main tasks is to delete all the unnecessary applications on the computer. Ironically when I moved to OS X I almost panicked at the realisation that there are no uninstallers for OS X applications. Windows users reading this will likely think it ridiculous there are no uninstallers on OS X.
Now I know why OS X doesn’t have them.
I have, say 50 applications that I need to remove. My only choice is to remove them one by one from the hideous "Add & Remove Applications" control panel applet. There’s no multi-select people.
If that wasn’t bad enough, it is SO SLOW. Every one boots up some installshield or other rubbish, prepares its wizard… then you get all these wonderful messages and questions:
- This action will remove application X from your computer. Do you wish to proceed? (YES LEAVE ME ALONE)
- File X is not used by any other applications, would you like to delete it? (WHY WOULD I WANT TO KEEP IT!)
- This software trial has expired! Buy or Exit? (F&%^ YOU I’M UNINSTALLING IT)
- Would you like to Modify, Repair or Remove? (I CHOSE REMOVE!)
- Do you want to completely remove this application and related files from your computer? (COME ON!)
- Uninstall was completed successfully (REQUIRES CLICK ON CLOSE?!!)
- This program is ready to remove BookmarkBridge. Press the Start Button to perform the uninstallation…. I click Start and THEN get another popup "This will start the uninstallation procedure. Do you want to continue?". After it has done it all, I then have to press OK to "The uninstallation has been completed". Beyond a joke.
- Deleting file X… Y… Z (WHO CARES WHAT FILES GO)
And … oh… the slowness of it all. This isn’t a slow PC but it grinds and grinds. InstallShield seem to have a special knack of bringing PCs to their knees with a simple wizard.
Windows users: the difference in the Mac philisophy is very hard to explain when you haven’t migrated to Mac, although in principle it is very simple. All the above messages and questions that make removing these applications a major chore are utterly pointless and the result of people writing applications the way they’ve seen everyone else write them for Windows. Therefore Microsoft set the "standard" by which these applications should behave, and they are ultimately responsible for the pile of crap that you have to deal with day to day.
On Macs, Apple takes a lead and tries to guide developers through the process of developing application "patterns" that don’t cause irritation to the user, do what makes sense, and "just work". This really is the essence of it all: Microsoft are 100% lacking in any concept of usability and aesthetics, and these things really do matter.
Aside from all this application removal pain, all the applications look like crap, by people with no clue that design and function need to work together as a whole to produce a satisfying product. User experience is not about the huge number of menu options you can provide!
Grails script notifications via Growl
Now that Grails 0.5 is out, I want to share how I use Growl on OS X to tell me when scripting tasks have completed.
This is very useful for me as I multitask heavily and will often leave a grails run-app or test-app running in a background terminal window. Using Growl – which provided pretty popup notification infrastructure for any application – I get a nice message in big text sliding up the bottom of the screen to tell me when Grails is ready for me to get back to it.
First, you need to install Growl, and then install the growlnotify shell command which can be found in the DMG, under Extras/growlnotify. I found I had to copy the files from there onto my HD and run install.sh as superuser. I didn’t worry about messages relating to the man page.
Test this by running this in a command window:
growlnotify -n Grails -m "Hello World" Grails
You should see a popup Growl message. If not, check your PATH etc.
Next, you need to copy the following code and save it in ~/.grails/scripts/Events.groovy :
Ant = new AntBuilder()
// StatusFinal event is triggered with the last message// supplied by a script target. eventStatusFinal = { msg -> growlNotify(msg)}
// StatusUpdate - every status message that is non-finaleventStatusUpdate = { msg ->// I don't need all these so I don't use growl here// growlNotify(msg)}
// Do the business with growlnotifyvoid growlNotify(String message) { Ant.exec(executable:'growlnotify') { arg(value:'-n') arg(value:'Grails') arg(value:'-m') arg(value:message) arg(value:'Grails') }}
Once you have this in place, go to an existing Grails project that has been upgraded to Grails 0.5 and do grails-run-app or similar. You can go to the Growl preferences pane and change the message style for just the Grails application also. I have mine set to the Music Video style and it looks something like this:
OK so you won’t get the Grails logo there, you’ll get a terminal icon. We don’t have a decent icon ready yet, but that will come in the future. To specify an image you just need to add a "–image filename" argument pair to the growlNotify function, and have a suitable image.
Current limitation – I can’t get growlnotify to generate different categories of Growl events, so you cannot customize the messages in a fine-grained way, you can only customize the look of all of them. If growlnotify can do this / adds this in future then we could have different display styles, times and priorities for these messages depending on the type of event that triggered them.
Other interesting possibilities:
- Change the script to send growl notifications to another machine on your network. This would enable you to get notifications from a remote test server
- Move this code into a GrowlNotificationPlugin for Grails, which can then be trivially installed in any project. Plugins can hook into events too by putting Events.groovy in <plugin>/scripts/
The full documentation and list of available events is here. Beyond notifications, scripting events promise to enable a whole load of interesting features in future including automatic addition of new created artefacts to SVN/CVS, and plugins that modify their behaviour based on other plugins being added.
Grails 0.5 – great new features
Great news – Grails 0.5 is now publicly released.
Full release notes are here but highlights for me include:
- Auto reloading of modified domain classes and transactional services, and quartz jobs. There isn’t much that won’t reload now, without restarting the dev web-app container!
- Everything has a log object provided for you now with zero effort
- URL mappings – set any url patterns you like to route to any controller/action and the taglibs that generate links do this mapping in reverse so your links are to nice URLs
- Command objects – validate form submissions that don’t related to domain classes directly etc.
Go get the latest version and have a play. Every version of Grails makes development more fun.




















