Archive for the 'Java' Category

Revenge of the Groovy Guys

Okay, okay, I’ll humbly admit I was wrong. A little bit. About ehm… that Groovy thing. An inspiring session by … about the Grails framework made me see things from a different perspective. There’s actually some quite nice features in Grails that could well be of use in Rails (or in some cases, Rails on JRuby).

For example, I’ve been looking for some time now for a system that would allow custom html tags in Rails’ rhtml files. The idea is to allow for all sorts of html tags, for example

  <r:for_each list="some_list" var="item">
    <li><%= @item %></li>
  </r:for_each>

This would then trigger a method named for_each (e.g. in a app/helpers/application_tags class) which could process the passed inner html block in any way you want (in this example, probably looping through some_list). Even though Ruby code in rhtml is usually not hard to read, it would still clean things up a bit and get rid of some duplicate code.

In short, it turns out that Grails already has this. Grails also has deployment to war (which is still experimental in JRuby, it’s the first thing I’ll try out once I’m back home from Belgium). And because Grails is built on top of Spring and Hibernate (amongst others), it’s easy to script-prototype your model classes that could be Hibernate-mapped or EJB3s. To be honest, that one isn’t any more difficult in JRuby if you see how easy it is to call any EJB.

Another interesting Groovy/Grails language construct I saw:

Book.get(params.id)?.true

The interesting part here is the question mark operator. This will (apparently) check if get() returns null, and if so, prohibit an error being thrown. There was an interesting discussion about this some time ago on rubyenrails.nl (in Dutch; I’ll post the link when I’m home), looking for ways to do this in Ruby.

All in all, I’m still not comfortable with the Groovy syntax (too many curly braces and arrows; and I’m missing semicolons at the end-of-lines–it’s not Ruby after all!) but there’s definitely things to learn and shamelessly steal from those Groovy and Grails guys.

2006-12-14. 6 responses.

JavaPolis day 4, The Monkey in the Details

On Thursday, Marc Fleury finally delivers his keynote on the open source business. I get distracted by circumstantial details like Fleury’s ridiculous “Public Enemy #1” costume (reminds me of Steve Ballmer’s stupid monkey dance) and An running around him with her camera like a groupie, trying to catch Marc’s best angle (what lens is she using? why does she never use a flash?). Oh man, Marc is actually dancing now. See you soon on Youtube…

(I can imagine you’re getting tired of my supposedly witty blog post titles. Don’t hold back, let me know, leave a comment!)

UPDATE


Marc Fleury at the mike for his JavaPolis keynote

2006-12-14. No responses.

JavaPolis day 3 continuated

Wednesday afternoon, JavaPolis really got into gear for me. I saw short ‘quicky’ sessions on Unitils (don’t like the name but some of the features (assertion through reflection!) could be very useful to me, as I’m writing tests on a daily basis) and Strecks (Struts extensions that can easily be used in an existing Struts environment–all the more pity it requires Java 5; won’t most existing Struts-based applications still be using Java 1.4, like the project I’m on right now?).

Next, I did a lab on NetBeans and Matisse, the NetBeans gui design tool. It really brought back memories of my Delphi days. I must say, NetBeans feels slick and fast and stable. Add to that the Ruby support that Tor Norbye is working on, and this might well become my next IDE of choice. We got a small sample of that in Charles’ and Tom’s conference session on JRuby, which was next. Charles showed things like usage highlighting and local rename. It might not be spectacular for a crowd of Java-with-(probably mostly)-Eclipse coders, but you’ve gotta start somewhere! (But on the other hand, Eclipse so often gets it ‘just right’–like in 3.3, the local rename got enhanced to operate locally within inner loops; such a small thing but something that happens often enough).

By the way, if the JavaPolis team is listening: those labs could do with some more publicity. Only four people out of 2800+ showed up. Maybe because the labs are somewhere in the back of the conference guide; I just found out myself a few minutes before it started. Maybe because the location is a very dark corner of MetroPolis. Worse, there was a loudspeaker directly above the lab location, blurting out advertising for MetroPolis at a very high volume (every 2 minutes Eddy Murphy shouting “Show me the candy!”, argh!).

I liked Brian Goetz’ session last year, and this year he was just as enthusiastic, showing us the reality about some Java performance myths. I know now that object allocation is normally not slow, and synchronization isn’t always slow either. Best myth however was “Clever code is faster code”. It turns out that, in normal situations, the best performing code is cleanly written code, following standard guidelines. Java is not a one-liner language.

It had already been a long day when we sat down for Geert Bevin’s session on continuations–in Java. This is definitely a fascinating concept; for using it in web applications however, it just might be too different from the way we ‘normally’ do things. It requires nothing less then a paradigm shift in web app development. More info on continuations can be found on the RIFE site.

2006-12-13. No responses.

JavaPolis day 3, Keynotes and Keynots

Another unexpected program change at JavaPolis brought us Oracle’s Omar Tazi (director of SOA evangelism and Chief open source evangelist) instead of Marc Fleury in Wednesday’s keynote session.

Unfortunately, a school example of how not to do a presentation. We got an hour-long talk of Omar clicking away on his laptop, showing All-New Oracle product after product, one enterprisey acronym after the other, all the while complaining about how little time he had left for his presentation (actually counting down the minutes). At the same time it’s sad to see the Web 2.0 revolution being enterprisified by companies like Oracle–and in name only, because the JSF+Ajax screens filled with components stacked from top to bottom, are all but what Web 2.0 has been about. Then again, knowing Oracle, I’ve probably been watching a demo of Web 2.0.13.10…

The Sun keynote provided more fun, even though I had already seen most of it at this year’s NLJUG JFall session: Simon Ritter’s Sun SPOT robot cars chasing eachother, and Angela Calceido’s cyberglove directing the mouse pointer in LookingGlass. We also saw a short promotion video with Richard Stallman giving praise to Sun’s open source move (he’s getting old… I thought heroes weren’t supposed to grow old…).

But before all that, Stephan Jansen started off with the usual JavaPolis introduction. Over 2800 attendants this year from all over the world, making the venue, MetroPolis, almost too small. There have been lots of small improvements this year; more food and free wifi being the most basic ones. Too bad that the free wifi and the dns server behind it are very hard to connect to. But what’s really a shame is that the speakers aren’t provided with a guaranteed working connection; several demos had to be cancelled because of that.

After the keynote we went downhill again, with a session on Apache Tuscany by a very (very) nervous Andrew Borley, poor guy. Sheet after sheet filled to the brim with bullets and text that was being read outloud almost literally. The technology itself is really interesting from a SOA point of view (an open source implementation of Service Component Architecture and Service Data Objects, supporting components written in any language like Ruby or Java, interoperable via SOAP or REST)–but really it hardly comes across this way. I’ll visit the website instead.

2006-12-13. No responses.

JavaPolis day 2, Best of Both Sides

I’m being urged to choose sides. Colleagues say I should specialize in either frontend or backend development. I’ve never liked to commit to any specialization. Partly because I’ve always admired the renaissance ideal of the uomo universale who knows and does it all. But also because, when I started out my career, 20 years ago, jobs were a lot scarcer then nowadays, so you couldn’t be all too picky about which job you wanted to do. Specialization is nice until the market changes and you find yourself out of a job because you happened to choose the wrong side.

All this might explain why I enjoyed a full day of Swing yesterday at JavaPolis, even though my day job is now exclusively about backend domain design and coding (and I love it, I love being in the silend, cold spelonks that the domain is, where everything perfectly fits, everything is under tight control with unit tests, and the evil outside world of user interfacing is far far away).

To be honest, the alternatives didn’t appeal to me either. A session on POJO programming–who on earth can talk about plain old POJOs for three whole hours? Or what about a Spring 2 session? Never mind, I’ll read the release notes. Now Swing, that’s something you want to see live. Not that there were many flashy demos though; just a very cool mashup that allows you to map your holiday snapshots to a route you can draw yourself on a Google map. Most of the time was filled with new Java SE 6 features, tips & tricks, a useful tutorial on Java Web Start, and an interesting but theoretical presentation on humane user interfaces (by Romain Guy).

Those new SE 6 features, they’re nice enough, sure; but it made me think back to my Delphi days, about 10 years ago, when we already had things like date pickers and hyperlinkable labels. In a way, it’s really the same as with all the fancy Ajax stuff. We’re all so excited about a web page that can behave like a desktop application; but if we’re actually developing a desktop application, then why bother with web pages when we could have made life easier and used Swing instead?

2006-12-13. 3 responses.

« Prev - Next »