JavaPolis day 1: mixed feelings

When expectations are high, you’re invariably up for some disappointment. Charles and Tom were unable to demo Rails-in-a-war-on-Glassfish; but at least they gave a warning in advance. But I definitely expected something more–or rather something else–from Eric Evans’ university session on domain-driven design (ddd).

The afternoon session on scripting languages went well enough anyway–or at least, the JRuby part did. The session took off with a theoretical explanation of JSR-2something (the support for scripting languages in Java SE). After that, Charles and Tom got their chance to warm up the Java-minded public for all goodness of Ruby. It took a little while for them to get comfortable, but then Tom was at the keyboard showing the simplicity of building a small Rails app from scratch; and Charles got the flow of the presentation going, explaining what Tom was doing and going into JRuby details. The hour flew by for most of the audience. When I got back after the half our break, Charles and Tom were still answering questions.

Charles and Tom showing some well-known faces

Now you have to believe me, in the 90 minutes of Groovy that followed, I did keep an open mind. I tried to look at the code samples objectively. I tried to admire the work that has gone into creating a dynamic variant of Java. I really tried hard to imagine a scenario where I would be tempted to remotely consider using Groovy in a real-world app. Okay, and I was also just a little bit busy trying to get my laptop to talk to the JavaPolis wireless network, which wasn’t easy either. But at least that one I finally succeeded at. The Groovy thing–I’m afraid it’s not for me. It gives me the worst of both worlds: no sweet Ruby syntax, and on top of that uglified Java syntax as well. Maybe next time I’ll see the light. I promise to keep an open mind.

The thing that most disappointed me however, was Eric Evans’ morning session on domain-driven design. Not that it was a bad presentation, not at all. Maybe it’s all about expectations. I expected an introduction into ddd. What is it, what’s so great about it, why should we use it, what lessons have been learned, what tips can a ddd guru give us? Instead we got a session about domain modeling: how do we get from use case to domain model. And also, if we have multiple models within our application/organization, what patterns can we discern regarding the interfacing between those models and the teams that design them? Interesting enough, no problem there; but what does this have to do with ddd? Domain modeling like this can well be done without any domain-drivenness. Or can it? I’ll know more in a week or two, when Evans’ book that I ordered will arrive.

2006-12-12. 6 responses.

JavaPolis 2006, a good start

Just arrived in Antwerp, Belgium, for the JavaPolis 2006 conference which starts tomorrow morning. Same venue (Metropolis, where I stopped on the way to pick up this year’s goodies bag), same hotel (Astrid–yeah I know it has a tacky name but it’s really not that cheap). Fortunately, the state of Antwerp’s wireless networking has advanced in a year’s time; I now have free wifi in my hotel room as well as at the JavaPolis venue. Allowing me to write this short blog entry.
And so I won’t be accused of blogging just for the sake of it, just because I can blog, I will list the university sessions that I’ll be attending tomorrow.

  • First off is Eric Evans, talking about domain-driven design. This promises to be not only a theoretical introduction to the subject, but also an interactive domain modeling session. I’ve been looking forward to hear more about ddd since visiting Sogyo’s evening session two weeks ago. Especially as that session has left me confused whether Rails might be seen as a domain-driven development framework. I’m still not convinced; maybe tomorrow’s session will bring some clarification–and new arguments!
  • In the afternoon, I’ll be at room 4 for the Dynamic Languages session. More in particular, for the JRuby part of that one. Originally, this session was scheduled as an all-JRuby university session; but somehow, the Groovy guys have managed to squeeze their way in as well. I really don’t see the point of Groovy, other than proving that Java can be as cool as Ruby if only we mutilate the language enough and make it dynamic. I promise I’ll keep an open mind during their session tomorrow, though I don’t think I’ll be able to take in anything after seeing Charles and Tom perform the miracle of Rails-in-a-war-on-Glassfish.

The all new JavaPolis 2006 bag
The all new JavaPolis 2006 bag

2006-12-10. 2 responses.

Domain-driven Ruby on Rails??

Yesterday evening I attended a session on domain-driven design (ddd) at Sogyo‘s offices, a nicely converted farmhouse located somewhere in the center of Holland. I was amazed to hear Ruby and Rails being used as an example of domain-driven development. One of the presenters even claimed that Dutch Rubyists Remco and Michiel (who reached 2nd place at this year’s RAD Race, a programming contest) had done so well because they were able to work domain-driven, thanks to Rails.

Surely he was joking. If there is one data-centric framework out there at the moment, it has to be (my beloved) Ruby on Rails. Let’s see…

  • Rails’ “domain” classes (the model) are literally an implementation of the Active Record pattern, which has a direct coupling to corresponding database tables.
  • As a result, Rails’ model classes correspond directly to database tables; a change in your table (e.g. an extra field) is automatically a change in your model class.
  • Worst of all, DHH is actually on a mission to model the whole world under the constraints of CRUD.

I really don’t see how you can call this domain-driven. This is not to say that you couldn’t implement a domain model (as in ddd) in Ruby. But in my opinion, that is not what Rails is about. Rails is limited to the presentation layer, so its model is nothing more than a view model. For small scale applications that’s good enough. But if you need your business logic to be available independantly, to be accessible from multiple views (presentation layer applications), you’ll want to put that business logic in a separate layer, not in the model of one of those views. That is how I see “enterprise Rails”: as a tool to rapidly develop presentation side applications that use and combine existing business services (WS, EJB) (using JRuby on a Java application server).

The question remains if a domain model could be implemented in Ruby (not Rails). Technically, you could, of course. But would I want to? I’m not sure. It’s very reassuring to have the Java compiler checking your back and Eclipse’s refactoring tools at your disposal. You’d have to have some very tight unit testing to replace those and still feel safe about any changes you make. I mean, we’re potentially talking about a large company’s vital business rules here. Would I feel comfortable duck-typing those? On the other hand, there’s Ruby’s excellent DSL capabilities that would come in very handy for specifying exactly those business rules. What do you think?

2006-11-30. 9 responses.

Down and Out in Toulouse and Oslo

Rådhuset, Oslo After being completely flushed away by heavy rain last week, from the streets of Toulouse, M. and I now find ourselves in the city of Oslo. She has to work, I get to play. Or at least to wander around the city a little. Disappointed by the (walking) distance from the hotel to the Munch Museum, but also pleasantly surprised by the radiant, sunny weather (although the sun doesn’t seem to reach much higher than in Holland on a midwinter’s day–it does make you very aware the you’re closer to the pole), I decided to change plans and explore the city center and the harbour. So I walked round, all the way down Universitatsgata, which eventually leads to a strange looking, huge red brick building with two towers, called Rådhuset (town hall), behind which you’ll find the waterfront: a little fish-auction where fresh fish (I’m assuming it’s fresh) is being sold directly off the fisherboats, and a long quay winding along Aker Brygge, which appears to be Oslo’s Port Vell, with restaurants and shops on one side, and yaughts and ferries on the other.

Aker Brygge, Oslo There’s a smell of seawater, shrimps and diesel oil; shrieks from the seagulls flying around; creaking of boats on the gentle waves; sharp light of the sun low on the horizon; a murmur of the Norwegian language that creaks much like the boats do; and of course the constants sound of rippling water. There’s an old looking seagull, lying near the edge of the quay, looking out over the water, bathing in the sun, with a tired look on its face; it won’t budge however close I get. Is it near its end, waiting to die, reminiscing over the days when it would fly around freely over this harbour, hunting for fish, scavenging for people’s leftovers?

Carcassonne By Night A french-speaking couple walks by. It’s only four days ago that we left France after a two-week holiday, the car boot stacked with wine, driving all the way home from Carcassonne (where we stayed) in one day to have some more preparation time for Oslo. You can only travel so much, it seems, before you start getting enough of it–and it seems that M. is certainly reaching that point (she did four more trips this summer). What an impressive city, Carcassonne. Very touristy of course, but you can hardly blame the city for that. Carcassonne is a city in the south of France, some 200 km north of Barcelona. It was originally built as a walled city in the Middle Ages, then eroded away in the centuries after, because its walls weren’t up against newer methods of warfare (like explosives and catapults). In the 19th century, a French architect decided to restore the old city to its former glory, rebuilding the walls where necessary, as well as the coned roofs on the towers–and filling in some of the details using his own imagination. Which is of course always the danger of restoring things: you’ll be tempted to rebuild them “as they were”, being under the illusion that you end up with the original thing.

2006-09-20. No responses.

The Hot and Cold Summer

So much to do in this hot and cold summer (July: 36 degrees, August: 16 degrees) and so little to blog about. In case anybody wonders, this is what I’ve been up to lately.

Gone back two years in time: After I finally left the WebLogic project in May, a little later than planned, I was re-assigned to the organization I worked at two years ago. It was as if time had stood still when I got back there. Not only because there were many familiar faces to welcome me, but also because the entire development environment was pretty much as I’d left it. So it’s back to Java 1.4, back to Struts, back to EJB’s, back to this pre-SOA SOA architecture… Then again, as someone asked me: what would I use instead of Struts? What indeed, if not Ruby and Rails? Does it really matter which XML-infested Java framework you use? Would Shale or Spring MVC make so much of a difference? I get by because there’s a lot of code and XML to copy/paste from, but the amount of code that is the result is frightening.

Trying to keep up with the insane tempo of the JRuby guys: After trying to get Rails on JRuby to work for my NLJUG presentation in May, with help from Charles Nutter and Tom Enebo, the JRuby protagonists, I kind of stuck around on the JRuby mailing list, which reads like a Dan Brown novel (well it does if you like coding). I even got a small job, rewriting Mongrel’s HTTP/1.1 Ragel parser to a JavaCC grammar (Why is there no Ragel-to-Java translator? I wish I’d had the time to write one. Now I had to use JavaCC, which was rather frustrating, either because of the limitations of JavaCC, especially in its idea of regular expressions, or because of my own limited knowledge of parsing–but it’s here, checked in in a fresh new RubyForge project, ) and it seems to be working. Mongrel will work completely with JRuby if Ola gets his JRuby extension framework going, allowing you to extend the Ruby language with Java libraries as easily as you can now with C libraries.

Organizing the Java Summer Camp 2006: After last year’s success with Simon Ritter‘s presentation of Java 5’s new features (fortunately no-one seems to remember the train mixup that got Simon 50km away from the venue and cause Rietje (office Mom) and me to pick him up there and drive back at questionable speed), Profict decided to do another Java Summer Camp this year. Like RubyEnRails before, this turns out to be very time-consuming. Finding a theme (Java & Ajax), speakers (Greg Murray! Bram Smeets!), visitors (90+, we’re fully booked!), a venue (another castle!), seats, food, sound system, camera, parking space…

Got my first production-worthy Rails application live: as a side note to the Java Summer Camp, I rewrote the small Rails app that I used to keep track of the RubyEnRails visitors. It can now handle multiple events, multiple users, it sends bulk email to visitors, it exports visitor data to Excel to keep the managers happy and it has a new and improved gui (which took me longer to design then it did to code the application itself).

Busy finding new colleagues: Yes I know, I should be proclaiming the wonders of Ruby and Rails at all times–but the truth is, I don’t hate Java, I don’t mind (that much) doing Java as a day job, and I don’t mind working for a Java shop. Although I’ll never quit dreaming of my own world empire, someday, somehow–in the meantime I’m very happy to be working for Profict. In spite of its focus on doing application integration projects (some people love diving in at the deep end, writing code that never sees the light of day; but I prefer staying near the surface, where the code reaches the user’s screens); but there’s enough work to do at the edges of integration: portals for one; and there are always the external assignments that I’ve been on for the last couple of years (what’s English for detacheren??). But what I really like about Profict is the fact that it’s small enough to know everybody (no huge consulting firm for me, thank you). It is a close group of mostly very experienced people, formed over the years only ‘by invitation’ (employers asking those people around them to join that they themselves would like to have as colleagues). So maybe I shouldn’t advertise the fact that we’re looking for still more people on my blog, for everyone to read–on the other hand, if you’re persistent enough to read this blog entry, you’re welcome to come talk (well, if you live in Holland anyway)! Okay, end of shameless commercial intermezzo…

Done a Grey’s Anatomy and The O.C. marathon: If you hate The O.C., you have got to at least love its theme song: California by Phantom Planet. That alone makes me want to go there (or at least as soon as flying to the US becomes a little more relaxed again). And Grey’s, what can I say: it’s little more than the 835th romance-in-a-hospital show (St. Elsewhere, Chicago Hope, ER, Medisch Centrum West) but there’s something that makes me want to keep watching–maybe Izzie? (A supporting character is usually my favorite: Summer in The O.C., Chloe in 24, Paris in Gilmore Girls, Starbuck in Battlestar and of course Locke in Lost; the exception is Prison Break).

Making the switch to Linux: Somewhere in the process of getting Subversion with SSH to work under Windows XP, which proved a hopeless case, either with or without Cygwin or VMWare, I decided to to finally make the switch. I shrinked my XP partition (I’ll still need it for graphics and photography work, as I just can’t get the Gimp to do what I want just as easily) and installed Ubuntu Dapper Drake. It feels like coming home (I worked with VMS and Unix long ago). It’s still not MacOS yet, but at least my 3GHz Dual Core cost just a third of Apple’s new beast

2006-08-15. No responses.

Is Ruby the new Java? (live on stage)

Twice a year the Dutch Java User Group organizes a mini conference with sessions about Java, JEE, and everything related. In spring this day is called J-Spring (which has nothing to do with the Spring framework), in fall it’s called J-Fall. While preparing for RubyEnRails 2006 I thought it would be a good idea to enter a paper for the J-Spring, for an introductory session called Is Ruby The New Java?. I was a bit surprised when my paper was accepted, and even more surprised last Thursday (J-Spring day) about how many Java people showed an interest for my session: I got the big conference hall (and it really does look big when you climb the stage), filled with maybe some 200 people. Even though I got the usual nervous questions about things like duck typing and performance, I had the impression that overall, people really liked what they saw. Apparently Ruby and Rails are hot in Java land.

And likewise, Java is hot in Ruby and Rails land; allbeit with a slightly different angle. I’m talking about the JRuby project, an interface to Java allowing Ruby code to run under a Java Virtual Machine. JRuby’s ‘holy grail’ being to be able to run Rails applications in a Java application server. At this year’s JavaOne, JRuby lead developers Charles Nutter and Tom Enebo were able to show a working Rails application running under Tomcat. In spite of their help and a lot of emails, I did not manage to reproduce their setup for a demo at J-Spring. Instead, I showed how easy it is to call an EJB from Ruby, as well as a Rails application based not on a database but on a Java web service.

You might wonder what’s the use of such an interface to Java. Like I said in my J-Spring presentation, I believe it offers some great possibilities for the future of Ruby and Rails. Once Rails runs on the JVM, it becomes that much easier to use Rails within established enterprisey Java environments. For that to happen, Java developers working within those environments need to be convinced of Ruby and Rails’ added value. And so I hope that my presentation has helped to convert some of those Java developers to Java developers-who-want-to-develop-with-Rails.

If you’re interested you can download my presentation here.

2006-06-21. 3 responses.

RubyEnRails 2006 – The Week After

It’s been almost two weeks since RubyEnRails 2006, the first big Dutch/Belgian Ruby and Rails event. I think it’s safe to say that it was a success. Over 100 visitors showed up; we had an excellent venue and six very entertaining sessions:

  • Frank Oxener (Agile Dovadi) gave a live demo of building a Rails app and integrating with Google Maps.
  • Geert Rozendom (Newminds) told about his company’s efforts to integrate Microsoft Navision with a Rails frontend (we got some frowns here from people disliking anything Microsoft; well, a lot of people use Microsoft software, so deal with it guys!).
  • Michiel de Mare (Finalist) gave a Takahashi style introduction to object oriented programming with Ruby (up to and including continuations, a brave effort).
  • Stefan Kaes told us everything there is to know about Rails performance. He did a two hour session packed with tips and tricks for measuring, tuning and refactoring.
  • Wilco Bauwer is working on IronRuby, a Ruby compiler for .Net, similar to IronPython. There’s a lot of attention for RubyCLR, but not many people have picked up yet on Wilco’s project. He explained that the difference is that RubyCLR is building a bridge between native Ruby and the CLR, while IronRuby is a complete implementation of a Ruby interpreter in .Net (see for an explanation of the .Net lingo). Again some sour anti-Microsoft faces here, but they were all silenced in awe when Wilco got Ruby to play the Mission Impossible III trailer on the sides of a rotating cube.
  • Erik Veenstra, finally, Holland’s uber Ruby guru, did a session on metaprogramming in Ruby. He showed how to implement your own attr_reader/attr_writer methods, and, one step beyond, the road to creating DSLs with Ruby.

All in all it was a great day, fun to organize and a pleasure to meet so many Ruby and Rails enthousiasts at once. We should do this more often! Next time, we should maybe have separate Ruby and Rails tracks (most people want to do either Ruby or Rails; a shame really). And even though Huis de Voorst was a splendid venue, a more central location would perhaps be easier for most attendants. And we should have more sessions, and more advanced sessions. And onsite wifi so people can blog while they’re there. And less xxxl-sized t-shirts (there’s still a few left!). And, and, and……

(The presentations can be downloaded from, but they’re Dutch except Stefan’s. Photos on Flickr, tagged rubyenrails.)

2006-05-30. One response.

A Truely Historic Rails Conference

For some mysterious reason, there seems to exist a correlation between the temperature outside and the amount of entries on my blog. A sudden and long-awaited spell of sunny weather has been making Holland happy for more than two weeks now. In the evenings I am faced with the choice between sitting outside for a little longer, glass of chilled wine in hand, waiting for the sun to set and the blackbirds to start singing — or sitting inside, behind the computer, working on my blog. What a tough choice.

It’s good to see the weather’s changing though, from downright hot to a temperature better suited for, let’s say, a conference. One week from now we’re hosting RubyEnRails 2006, the first major Dutch/Belgian Ruby and Rails event. Besides Dutch Ruby guru Erik Veenstra, some real-life Rails cases, and Wilco Bauwer presenting his Ruby-on-DotNet compiler, Stefan Kaes is doing a two-hour workshop on Rails performance. And then there’s the Rails introduction workshop Remco and I will do, coding a simple photo album application live to show how quick & easy it all is (that’s the plan, anyway!). Over 100 people have already registered. It may not be London, Chicago or Vancouver, but we do have the most historic venue of them all: a 17th century Dutch castle.

Huis de Voorst

2006-05-11. No responses.

Calling All EJBs — From Ruby?

After installing and playing with JRuby a few days ago, I started wondering if it would be possible to access an EJB from a JRuby script. After all, the Java code to call an EJB is purely client code, only communicating with an application server over an HTTP-like protocol (HTTP-like in BEA’s case, anyway). At my current project, the OptimalJ team generates all their domain code and delivers business services around that in the form of session EJBs to us, the web frontend team. We’re using BEA WebLogic Portal to code the frontend. Now if we’d have EJB access from JRuby, and Rails on JRuby (which seems to be only a matter of time), I guess we would be able to build a frontend like this in Rails. There’s just the tiny matter of convincing the company’s enterprise architect, who’s already sick of hearing me talk about Ruby and Rails.

Anyway, to the code! To my surprise (after 6 years of experience with EJBs, anything EJB-related working instantly comes as a great surprise) it was just a matter of JRubyfying the Java code that you would write to use an EJB. It just works, there’s nothing more to it. Here’s an example of the magic code:

require 'java'
include_class 'java.util.Properties'
include_class 'javax.naming.Context'
include_class 'javax.naming.InitialContext'
properties =
properties.put(Context::PROVIDER_URL, "t3://localhost:7001")
context =
home = context.lookup("business-ejb-jndi-name")
business_ejb = home.create
result = business_ejb.someBusinessMethod(parameters)

Okay, here’s some small print. The example works on a BEA WebLogic application server. For another JEE application server you’ll need to fill in the correct InitialContextFactory class name. Fill in the JNDI name for the EJB after the lookup call. Also, before running the script, you’ll have to put the right libraries in the CLASSPATH environment variable. For example, for the BEA server I had to include weblogic.jar and the EJB client jar containing the home interface to the EJB. But once you’ve figured that out, it should work; I got it to work on JBoss as well as BEA. Consult your local Java guru if necessary.

I’ve put all this in a JRuby module (to be downloaded here), which enables you to write just this to call your favourite EJB:

require 'rejb'
business_ejb = Rejb::ejb("business-ejb-jndi-name")
result = business_ejb.someBusinessMethod(parameters)

I’ve been feeling very happy over the last few days, even though there’s no Spring in sight. Must be the summer of Ruby that’s coming…

2006-04-13. 4 responses.

Rails Team Ends Second In Dutch Development Contest

In Holland we have a yearly development contest called “Development Tools” (formerly RAD Race). In two days, several teams consisting of two coders build an administrative application according to fixed requirements, with database access, forms, reports, the works. The contest was originally organized for 4GL RAD tools, but in recent years Java teams have entered the competition. Without too much success though, for no Java team has up till now managed to beat the 4GL tools. This year, for the first time, a Rails team joined up. And not just any Rails team; my co-bloggers from ““, Remco van ‘t Veer and Michiel de Mare were in it. Today the results from the contest were published, and guess what — Remco and Michiel came in second! They beat all the Java teams; first place was for the CrossmarX Application Engine. Congratulations to Remco and Michiel, and to Rails of course!!

2006-03-29. One response.

« Newer - Older »