Friday, June 29, 2007

Seam 2.0 beta with Groovy Support

Just wanted to say congrats to the Seam guys who have added Groovy support to the latest 2.0 beta. I know they (Gavin, Emmanuel etc.) have been putting a lot of hard work into making Seam easy to use whilst still trying to remain true to the Java EE standards and I think adding dynamic language support, in the shape of Groovy, is a great step in the right direction.

I've said it before and I'll say it again, one of the reasons the Java eco-system is so fantastic is you have a choice. Sometimes too much of a choice, but it is a wonderful space to be in.

Wednesday, June 27, 2007

RE: Is Scala the new Groovy?

Well it looks like Alex Blewitt has taken the time to excrete some more complete and utter rubbish all over the blog-o-sphere. Clearly, Alex got screwed over big time by the Geronimo guys and is feeling rather, well, left out and hence has chosen to vent his anger on the projects that James Strachan has participated in. Like Groovy.

His article is a complete and utter joke from start to finish. Where shall we begin. First using his clearly limited knowledge of Groovy he claims that it is interpreted. Here is a wake-up call Alex, no it isn't. Groovy is compiled down to byte-code. In fact its not even some weird proxy-like byte code, a Groovy class is a Java class.

He then claims that you can run Groovy on a "cut-down VM". I mean what planet is this guy on? Groovy runs in the standard VM, Alex. Yeh seriously. He even can't get his JRuby facts straight, calling on all his knowledge to claim JRuby doesn't support all of C Ruby's semantics. I think Charles would have a word to say about that.

He then claims that Groovy doesn't have a presence in the enterprise like Python and er.. Ruby? Alex, seriously, have you been in an enterprise lately? They run Java. No joke. Sometimes you get some C# on the client, but seriously Groovy has plenty of presence and there are multiple success stories on this area. In fact Groovy tends to be "just used", without justification obtained, its just another JAR after all.

He claims the Groovy community has a "not-invented here" syndrome. Listen Alex, I'm quite happy to inform you that we based many of the ideas in Grails on Rails and even some of the ideas in GSP on JSP. It seems to me with your Geronimo-envy that it is you that has the problem.

Next-up, he shifts his all knowing, educated knowledge onto the topic of Scala, claiming its a dynamic language to rule all other dynamic languages. Scala is a great language and together Groovy and Scala are phenomenal additions to a Java programmers toolkit, but Alex Scala is not a dynamic language. You seriously need to do your research before writing such complete nonsense.

Scala is a statically typed language with support for functional programming with anonymous functions and closures as well as type inference. It is not, however a dynamic language nor did the designers ever intend it to be. It also has great support for parallel programming, so if you're a Java programmer check it out, but don't check it out because "it is the new Groovy" as Alex claims as you'll be sadly disappointed.

Just to be clear, for the benefit of Alex, Groovy is a dynamic language that supports meta-programming and a Meta-Object Protocol (MOP) like Smalltalk, Ruby and to a certain extent Python. Scala is a statically typed language that supports functional programming more like Haskell.

In fact I should probably do another Myth #X post and just point it to his blog post with a big sign saying "read this and believe none of it". Hopefully, after a few more blog posts that rip into James' previous projects Alex will have exercised his demons and the blog-o-sphere can return to peace.

Friday, June 22, 2007

British Airways: The biggest shambles this side of the Atlantic

Update: My flight has now been delayed until 22:03 since writing this article. It gets better. How they managed to estimate that time to the minute is beyond me. If BA were as good at arriving on time as they are at calculating how long their flights are delayed for we would be sorted.

So I am sitting here in Glasgow Airport (yeh that would be Glasgow, Scotland) waiting for my British Airways flight, which was due to depart at 19:40. However, much to my disgust it has been delayed to 21:20. Now it is not unusual for flights to be delayed, however this is the sixth time I have flown BA in the last 6 months and guess what? Every single flight has been delayed both going out and coming back.

The first time I was like "Well, ok. Every airline has flight delays, even BA!". Then the next time I was "Oh, hmm this is really not good of BA, they're usually so reliable". The third time my demeanor slowly degraded "This is really unacceptable, I can't believe an airline like BA can get it wrong so often". And today? Well I'm fuming. I am beyond angry at this steaming pile of the proverbial that calls itself our national airline.

Due to BA I am instead sitting in Glasgow Airport's below par canteen for dinner instead of having a home cooked meal. Because of BA I am relegated to sneaking into my house in the middle of the night and tip toeing up to bed whilst the rest of my family sleep, instead of being able to be welcomed home at a decent hour. I am honestly disgusted.

It is not like I have not used other airlines. I have flown on Ryanair, EasyJet and Iberia in the last 6 months and none of them have been delayed. How can BA claim it is a "superior" airline to Ryanair and EasyJet when it can't even get the basics right? I mean seriously, on two previous occasions with BA they even managed to lose my flight details even though we had booked the flight and had evidence of doing so!

Just to round the picture off when you actually do get on the flight the food is diabolical, at least on EasyJet and Ryanair you pay for what you get. In all honesty BA are a sham, a complete disaster. They are worse than EasyJet and Ryanair. In fact I would go as far as saying they are perpetuating false advertising with their marketing campaigns that attempt to place them as a "quality" airline.

The funny thing is if you tell someone who actually works for BA this, the first thing they do is blame the ground stuff at BAA. Now I'm sure that the ground staff are equally incompetent, but for heaven's sake the problem has to be corrected somewhere in the chain. Personally, I'm of the view now that there is no compelling reason to chose BA over a budget airline like Ryanair or EasyJet. BA are quite simply awful, and unfortunately for them the leather seats don't make up for it.

Thursday, June 21, 2007

Grails vs Rails Myth #1: Grails has a fraction of what Rails has to offer

In this post the author proclaims boldly that Grails has a "fraction of RoRs functionality". So in the spirit of Relevance's myth series (I'm not sure I'll do more than one of these, we'll see) let me sum up my feelings on this.

I would like to have jumped right onto the Rails bandwagon if it hadn't been for the fact that ActiveRecord offers only a fraction of what Hibernate does.
  • Where is the proper transaction & conversation support?
  • Why is it that it hits the db orders of magnitude harder that Hibernate does and is infinitely slower?
  • Where is the criteria support? What about distributed caching?
I would be Ruby maniac right now if Ruby didn't offer only a fraction of what is available in Java. From the reams of web frameworks, to the dozens of persistence engines, to distributed caches, enterprise integration tools and testing frameworks. Java has it all. There is literally a library for everything.

And I would probably have said a long goodbye to Java, if it wasn't for the fantastic innovation that is happening in projects like Spring and Hibernate and the libraries that integrate with them (Quartz, Sitemesh, Compass, Acegi, Webflow et al) which Grails is built on. Want an RMI, burlap, http, soap or DWR service? Just expose one. Need advanced declarative security at the web and business layer level? Plug it right in. Job scheduling? Job done. Search? Sure no problem.

Spring and all the projects that integrate with it, make the Java ecosystem a very happy place indeed. So no, Grails might not have RJS (yet), migrations (yet) or xyz feature from Rails, but it has plenty, thanks to the Java eco-system, to make up for it and then some.

Thursday, June 14, 2007

Open Letter to Google: Fix Gmail on Safari

Dear Google,

I'm a regular Gmail user on the Mac. I love Gmail, but I'm torn because I love Safari too. Now that Safari 3 beta is out I feel particularily left out because Gmail is so fundamentally broken on Safari. Maybe there are some deep technical reasons why Gmail doesn't work in Safari 2, but I hope that they can be addressed on Safari 3. So Google, please, please address the following issues so I don't have to keep using Camino for Gmail:
  • The back button - this is the most annoying and it is fundamentally broken on Safari. It keeps taking you back to the loading screen. Please fix this it makes Gmail on Safari unusable
  • Google Chat - this simply disappears on Safari. Please enable this feature as it too cripples Gmail
With these two problems recitified I would have entered Gmail on Mac nirvana and with Apple and Google's apparent close working relationship these issues should really be addressed otherwise Steve's claim of Safari being the best browser in the world (although this is clearly part of the Jobs reality distortion field) just doesn't hold true and neither does Google's commitment to Apple.

Graeme Rocher

Friday, June 01, 2007

Dynamic Groovy: Groovy's Equivalent to Ruby Open Classes

A lot of hype has been made of Ruby's open classes, and for good reason as they're pretty darn cool. Since Groovy classes compile down to byte code (ie a Groovy class is a Java class) it has always been a little more problematic to add dynamic features to classes you don't have control over.

If you're the class implementor for example you could override invokeMethod and getProperty, but if you're not your only option was Groovy categories, which aren't nearly as elegant, or implementing your own custom MetaClass which exposed you to Groovy internals and wasn't very fun.

However, this is all changing because I've just committed major improvements and written the documentation for Groovy's dynamic meta class mechanism, the ExpandoMetaClass. This is the system I discussed with Neal Ford at JavaOne who felt, prior to our discussion, that Ruby had the upper hand because of open classes. After our discussion and a short demo of what ExpandoMetaClass is capable of, Neal changed his mind and upgraded Groovy's rating on his language scale.

So in the next beta release, you'll see a new improved version of ExpandoMetaClass with features such as:
Here is a little example:

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))
assert "UpAndDown" == "uPaNDdOWN".swapCase()

ExpandoMetaClass has been at the heart of Grails for a while, so is completely production ready. Now its time to bring it to the masses with the next beta release of Groovy targeted for the end of June.