Wednesday, February 28, 2007

Grails big in Jamaica


Received this a while back from Michael Baehr, just hadn't got round to posting it. Yes Grails is big in Jamaica!

Interesting to see rampant sexism is alive and well in IT. ;-)

High res versions here. Thanks Michael!

Tuesday, February 27, 2007

Glen Smith builds feature rich Grails-powered blog aggregator in 20 hours

That Grails site building phenomenon Glen Smith, the man who brought us Grails+Lucene powered search engine Groogle, has completed his Grails 20 hour challenge to build a feature rich blog aggregator.

The result, although still requiring some minor tweaks, is impressive. Well done Glen! Grails-powered Groovyblogs.org has (almost) arrived!

Monday, February 26, 2007

Interview with Agile consultancy Refactr featuring Groovy/Grails

There is a nice interview with Refactr. An agile software consultancy who have seen the benefit of Grails and are embracing it in a big way. They talk about agile methodologies, working with clients in a consultative manner, their past experiences and why they choose Groovy and Grails for a lot of their work.

There views reflect the essence of Groovy and Grails and the appeal to existing Java developers with its tight Java integration and seamless integration with legacy Java systems.

PS Grails 0.4.2 is out

Thursday, February 22, 2007

The Grails eXchange 2007 Launches

Skills Matter have launched registration for the Grails eXchange 2007 a conference full of presentations on Grails, Groovy, Ajax & Web 2.0 and JEE and the core technologies that support the Grails technology stack such as JEE, Spring, Hibernate, SiteMesh, Dojo and Quartz.

Full Disclosure: I am employee of Skills Matter and project lead of Grails

Friday, February 09, 2007

Grails 0.4.1 out, Groovy just got more dynamic

Haven't posted in a while, but the focus for the last few weeks, Grails wise that is, has been getting 0.4 out and then putting out a sensible point release from community feedback. Grails 0.4.1 is that point release and is out now.

So now that things have settled down a bit I want to talk a little about one of the features in Grails 0.4 that really excites me. It is called the ExpandoMetaClass and what it does is bring to Groovy easy addition of dynamic features kind of like in Ruby's meta stuff and Javascript's prototype object.

Groovy has always had the underlying infrastructure to make magic happen, it has just been hard to get to for Joe user, particularly when coming from other languages with these features. In Grails, this is no longer the case and the plan is to move this functionality into Groovy core in the future. So how does it work in Grails?

Well say you have a class, it could be a Java or a Groovy class, and you want to add a method to it. Let's take java.lang.String for example. Say you wanted to add a new method that takes an existing String and swaps the casing of the String so upper case letters are in lower case and vica versa. This is how you do it:


String.metaClass.swapCase = {->
def sb = new StringBuffer()
delegate.each {
sb << (Character.isUpperCase(it as char) ? Character.toLowerCase(it as char) :
Character.toUpperCase(it as char))
}
sb.toString()
}


assert "UpAndDown" == "uPaNDdOWN".swapCase()


Job done. Notice the special use of the implicit "delegate" variable that equates to "this" inside the method. Now the nice thing is it is not just methods you can do this for. You can add constructors, properties, instance methods, and static methods (checkout the docs for more info) on any Java OR Groovy class. Hopefully this will help make Groovy Meta programming more accessible.