The Source for Java Technology Collaboration
User: Password:



Eamonn McManus's Blog

Community: Java Enterprise Archives


The Spring Experience 2006 (2)

Posted by emcmanus on December 18, 2006 at 06:54 AM | Permalink | Comments (2)

I'm writing this in what I used to think was the world's nastiest airport, where I have a five-hour stopover. I'm somewhat revising my opinion of the airport because I discovered a "Quiet Seating Area" with real seats and real quiet. A bit like a business-class lounge but for the plebs. So I'm sitting there typing this, with my laptop on a table and the charger plugged in and everything.

As I mentioned last time, I was at The Spring Experience 2006 in Hollywood, Florida where I was speaking about JMX stuff.

I had been surprised at how close the conference hotel was to the sea. In France, the infamous loi littorale forbids construction within a certain distance of the sea, unless you are a member of the Saudi royal family that the French state doesn't want to displease. The idea is of course avoid the sort of concrete nastiness to be seen in certain neighbouring countries.

Anyway, some local friends set me straight. When the hotel was built, the sea was further away! That doesn't happen much with the dull old Mediterranean, but over there in hurricaneland it's a different story. A constant battle with a shifting shoreline, in fact.

But back to your regular scheduled geekery. Here are some of the talks I attended.

Rapid Web App Development (Rob Harrop)

This was mostly about Spring Web Flow, so I'll leave detailed comments to the Spring experts. I came away with a few items of general interest:

  • Good tools are essential. Rob recommended having a good IDE (IDEA, Eclipse WTP, NetBeans). He was surely preaching to the converted here, but maybe there were one or two diehard Emacs users in the audience.

    [I like Emacs a lot, and in fact I'm typing this using it. But I wouldn't think of using it for serious Java programming. There have been valiant attempts at producing IDEs in Emacs, but even I am not mad enough to use them.]

    Rob also recommended the Jetty web server, at least for development. It starts in about two seconds and has reliable hot deploy, apparently unlike its rivals.

    Finally, Rob recommended Maven, notably because of its good integration with Jetty.

  • For serious work, you need to be able to attach to your app server with a debugger. It might take a bit of investigation to figure out how to do this, but it is a worthwhile investment.

    I use NetBeans and Glassfish, and this is trivially easy. Right-click on the app server in the Runtime tab and select "Start in debug mode". Then, with your web app as your main project, do "debug main project" (F5). NetBeans deploys the app, launches it in your browser, and attaches the debugger.

  • Rob demonstrated the use of JRuby for parts of the web app that may change often, such as the formatting within a page. Spring can be set up so that it continually polls the file containing the Ruby script for changes and reloads the script if it finds any. The result is that you can change the script and immediately see the result in your browser without any redeploy step. Requests that were in progress before the change continue with the old version, and new requests use the new. Nifty.

Spring and dynamic languages (Rod Johnson, Guillaume LaForge)

Rod presented the general Spring support for dynamic languages, such as Groovy, BeanShell, and JRuby. Then Guillaume, who is the current holder of the Groovy torch, talked about that language in particular. Script languages lend themselves well to interactive demos, with the presenter typing in some stuff and showing what it does. Several speakers showed this in fact, with varying degrees of success. Guillaume's demo went off well, except when he was smitten by the demo gods. His computer went spontaneously into hibernation in the middle, which caused Guillaume to emit a bad word.

I'm not sure what to think of Groovy, myself. On the plus side, it is very similar to Java, so easy to learn and read, and it has some powerful features. On the minus side, it smells a bit like Perl, with these individually-nifty features slapped together without a coherent philosophy.

JRuby (Rob Harrop)

There was some overlap with the Groovy talk here. Rob walked through some examples of Ruby programming, stressing the interactivity and the access to the Java platform classes. One thing I picked up on is that Ruby (and Groovy) can make the JMX API's Open Types much more palatable. You can set things up so that instead of accessing a field in a CompositeData using cd.get("maxTime") you can use cd.maxTime. In fact Open Types are an excellent fit for dynamic languages and I think we should revisit the JavaScript library in the script plugin for JConsole to take that into account.

Code organization for large systems (Jürgen Höller)

I went to this talk because I work on a large system (the JDK) and thought it would be interesting to see how others approach the problems that arise. However, I was a bit disappointed, because the talk was actually about one very specific problem, namely inter-module dependencies. Furthermore Jürgen's presentation was based on an assumption that I don't agree with, that modules in this case correspond to Java packages. The key message was that there should never be cyclic dependencies between packages. For example, java.lang and java.util have a cyclic dependency because java.lang.System.getProperties() returns java.util.Properties, and all the classes in java.util depend on java.lang, if only because of their common Object superclass.

An enormous amount of effort has been spent on Spring to ensure that there are no cyclic dependencies between packages, and Jürgen explained some of the details. But I don't think it is right to forbid interdepencies between closely-related packages. Minimize them, sure, but forbid them?

The problem is that the Java language doesn't currently have any higher-level way to organize code. What we really want to avoid is interdepencies between modules, where a module can be made up of several packages. But there is no way in the Java language to represent this explicitly. (There will be; see JSR 294.) To my mind that means you need an extra-linguistic representation, for example a file listing the packages in a module, or the de facto grouping into jars. Then you can check that there are no cycles. Forcing yourself never to have cycles between packages seems like much more work than it's worth.

Glassbox - Open Source Automated Application Troubleshooting (Ron Bodkin)

There was a bit of a screw-up for this talk, which was printed in the conference agenda with a different subject. As a result, there were very few people present. This is a great pity because Glassbox is an excellent piece of work. I had already demonstrated it briefly in my talk and encouraged people to come to this one, but to little avail.

I wrote about Glassbox here before, but as a reminder it basically does two things:

  • It uses AspectJ's code weaving to introduce performance probes into web apps. This allows it to accumulate timing statistics for various things of interest, such as servlet requests or database requests. The statistics are available through the JMX API.
  • It includes its own web app that analyses these statistics and signals possible performance problems, such as excessive lock contention or slow database operations. In each case it explains its reasoning. A plug-in API allows you to add your own analysis logic.

Glassbox also supports clustered monitoring, meaning you can see the analyses on several VMs from the same web app, including remote VMs.

Trends and the Future of Enterprise Java (Floyd Marinescu)

Floyd fired over 90 minutes of rapid and continuous speech at his audience in the last session slot of the conference. I left bewildered but informed. It was also the second time in less than 24 hours that I heard a Canadian say that what defines Canadians is that they are not American. So it must be true.

The technology trends he identified were these (quoting the slides, with [comments]):

  • Foundations of tomorrow's application design
    • AOP, Dependency Injection, Annotations
  • Death to components - the object fights back
  • OSGi redefining the notion of an appserver
  • Scripting languages
  • The Resurgence of the Java Platform [as constrasted with the Java Language]
  • Ruby on Rails & integrated platforms [also Grails]
  • AJAX & Rich Clients [also Flash/Flex]
  • Web Serviecs and SOA [put on your X-Ray skepticals]
  • Java Content Repositories [JSR 170]
  • The falling value proposition for EJB - can it come back?

Many of these are self-explanatory, but a few merit some further words.

Death to components - the object fights back. As I understand this the idea was that J2EE was not really Object Oriented. There was an unreasonable focus on remoting of application objects which led to twisted designs. With the switch to POJO-based frameworks (including EJB3) and better Object-Relation Mapping (again including EJB3), this changes. Well, I'm not really a J2EE expert so I might be misrepresenting the position here.

Domain Driven Design wasn't in Floyd's summary but he spent some time talking about it anyway. It was a strong theme at the conference with an entire track devoted to it, but I admit I had other interests so I put off learning about it for another day. I did notice that Domain-Specific Languages were mentioned frequently. Especially in conjunction with Ruby and Groovy which make it possible to construct DSLs that domain experts can read directly even if they are not programmers. In the spirit of objectivity, Floyd also mentioned Buko Obele's skeptical position regarding DSLs.

Regarding OSGi, it's clear that there was great interest at the conference in this. The talk on the subject by Adrian Colyer was very well attended and from what I heard extremely interesting. (Unfortunately it would have been technically rather difficult for me to attend since my own talk was at the same time.) Floyd felt that OSGi will lead to increased componentisation of the Java EE platform, so you could configure just those parts of the platform that you need, or deploy a bundle that contains not just your web app but the Tomcat server and configuration that supports it. I'm not completely sure that I'm representing his position correctly or that I agree with if so.

In the second part of the talk (I said it was long), Floyd talked about "Business/Political Trends", namely:

  • Dilution of influence of Sun and the JCP
  • Emerging Economies and Open Source
  • Apache Harmony [huh? didn't OpenJDK kill that?]
  • Java to be open sourced - success factors
  • Open Source Business Models
  • Areas for commercial models?
  • J2EE is already the plumbing of the future?

On Dilution of influence of Sun and the JCP, Floyd wandered off a bit into hyperspace and ended up not even agreeing with himself. But I think it is legitimate to note that there is a lot of de facto standardization going on through open source projects independently of the JCP. We were at a Spring conference after all. The only question is whether the word "standard" is completely appropriate in cases like this where there will in all likelihood only ever be one implementation.

Concerning Emerging Economies and Open Source, Floyd's most interesting point was that countries like Brazil want pure open-source platforms to protect themselves against the effects of possible future US trade sanctions. I don't know what to think of that position (whether it's true, and whether it's reasonable if it is true).

Concerning Apache Harmony and Open Source Java, the printed slides I am working from are seriously out of date and I admit I wasn't paying attention during this bit to see if the slides Floyd was presenting from were less so. Sun has announced the licensing terms, one of the two "success factors" covered. It's true that the full governance model has yet to be decided.

This slide was sufficiently striking to quote in full:

Harmony's only purpose was to slowly chip away Sun's resolve and force them to eventually open source Java, under constant threat that IBM would open source it's own Java.

Whether the meaning of the text is more accurate than its grammar is up to you to decide. (Oh all right, I don't really think that the two split infinitives are incorrect, but that apostrophe is.)

JMX Technology - Using it with Spring, and how it is evolving (me)

Here's what I learnt at this talk:

  • I surveyed the audience to ask how many people were using the J2SE 5.0 platform. About 60% of people were. I was a bit embarrassed that I would be presenting new Java 6 features to people who weren't even using 5.0 yet. (I wasn't surprised, though. We do consistently hear developers tell us they'd love to migrate to a more recent version but can't because their organisation doesn't want to have to requalify everything, or because some of their third party software isn't supported on the more recent version.)

  • The demo gods were very angry at this conference, and smote me just as they had smitten every other session I saw that presumed to include a demo. In my case I made a trivial change to a web app and redeployed it, just as I had rehearsed any number of times. But unlike all those times I saw an exception scroll past too fast to see, and the app server restarted! Since it takes a good two minutes to restart I had to abandon that demo and waffle, what you would have seen if the demo had worked.... The reason for the problem is surely buried in the app server logs but so far I have been too discouraged to look.

  • 90 minutes is an awfully long time to speak, especially if you still have some residual jet lag. I felt myself running out of steam towards the end.

  • People weren't aware that the release of the Java 6 platform was imminent. (It was coming up two days after my talk, though I couldn't be that precise for fear of spoiling the official announcement.) I suppose we had been talking for so long about all the wonderful things that were coming later that people assumed the later would be later than it was.

Blog time

I'm no longer in Heathrow as I type this. I'm in a TGV, four days later. It's been a busy ten days. I'm wondering what sorts of interesting philosophical things I could say about "blog time", the fact that you're reading in continuous time my text written in highly discontinuous time. Although I suppose that is true of most non-trivial amounts of text, and generally less so of blogs than of other media.



The Spring Experience 2006

Posted by emcmanus on December 08, 2006 at 12:17 PM | Permalink | Comments (0)

I'm at The Spring Experience 2006 in Hollywood, Florida (between Miami and Fort Lauderdale) where I've been invited to speak.

The conference hotel is very striking because it is on the seafront. In between sessions you can step out onto a balcony that looks out on to the Atlantic Ocean. Not many conferences can boast that.

I'm basically an interloper here, because I don't really know very much about Spring. The conference organizers invited me to speak about JMX technology, because I do know very much about that. But, since I'm basically a Java SE guy, this does lead to some perplexing situations. This morning I attended a session on the Java Persistence API where one of the presenters started off with what should have been rhetorical questions:

How many people work with databases? (Everybody raises their hand except me.)

How many people don't work with databases? (Just little old me. So what was I doing there? Just trying to see how the other half lives.)

I did learn quite a lot at this talk. Perhaps of the most interest to me (as part of the JDK team) was the fact that JPA needs Byte Code Instrumentation, in particular to support lazy loading. This can be via either -javaagent or magic ClassLoaders that modify the byte code of classes as they are loaded. The latter approach is called "Load-Time Weaving" (LTW).

At the keynote speech last night, Rod Johnson (the Father of Spring) enumerated the impressively long list of places where Spring is being used, among them the Voca system, used for nearly all inter-bank transfers in the UK, and the system that allows French taxpayers (like me) to consult their tax status. Of course Rod was preaching to the converted, since presumably everybody here is a Spring user. Except me.

One other thing I picked up is that BEA is using Spring as a core part of their forthcoming Java EE 5 app server.

Rod said a whole lot of other things during this keynote, but I was zoning out a bit since I'd been up for almost 24 hours at that stage, 24 hours that included a transatlantic flight preceded by a stop-off in Airport Purgatory.

Another theme that's showing up strongly is dynamic languages. In particular the notion of automatically refreshing the copy of a script being used by a live application, for example running in a web container. You modify the script in your IDE and save the file. The Spring container can be configured to poll for script file modifications and switch automatically to the modified version for new requests. This means you can modify a script and see the results of your modification in your web browser immediately, without having to redeploy the app.

I expect to be writing more later. My own speech is tomorrow!





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds