JavaOne 2006, Wednesday
JavaOne marches ever onwards. Yesterday was a pretty busy day. I had a huge block of classes in the afternoon, some interesting, some… otherwise.
Effective Java
Joshua Bloch from Google, who I gather writes a book called “Effective Java,” gave this one. It was fast paced, informative and in general a really good talk. He spent a lot of time on the various dangers of Java 1.5’s generics, delving deeply in to wildcard generics and their various ins, outs and what have you’s. Java’s generics always throw me off because they’re just different enough from C++’s templates to not quite make sense to me. This talk helped clear much of my confusion up, though.
EJB + AOP + NIH = Interceptors
At a bunch of the EJB 3.0 talks, “Interceptors” have been touted as the elegant solution for this, that and the other damn thing. Which, ok, fine. It’s good to have a way to solve a lot of different types of problems. I applaud this.
Interceptors are basically Aspect Oriented Programming constructs. The fun part is that instead of just going out and using one of the existing AOP frameworks, EJB built its own. Yeah yeah yeah, EJB is a big and complicated environment and you probably couldn’t just throw J-random AOP tools in there to make it all happen and you need to be able to make it work elegantly with all their different deployment techniques. Whatevers. This is why I try to stay away from EJB.
Also, memo to presenter: “Aspectizing” isn’t a word.
Groovy
I totally misread the abstract for this one and thought it was going to focus on porting scripting languages to the JVM. Turns out that Groovy is an entirely new — well, relatively new at three years old — scripting environment running natively on the JVM.
This really put me out at first and still sort of does. There are plenty of good scripting languages out there and people are pretty good at using them. Why write another one? Their reasoning was that they wanted something that would work like Java, make sense to Java developers, and play real real nice with existing Java code.
I was skeptical until I saw the demo. In maybe fifteen lines of code, the presented fired up an ActiveX proxy, fiddled around with an Excel spreadsheet, and created an admittedly small Swing GUI to control it. This is all stuff that you could do with regular Java, but it would take dozens and dozens of lines of code.
The Groovy folks have done really nice work using Java reflection to implement a Do What I Mean idiom — for example, you can pass a list of two integers to a window constructor, and it will figure out that the window has a constructor that takes a Dimension which has a constructor that takes two integers. Good stuff — that could make a lot of tedious tasks in Java not nearly as bad. This is definitely something that I need to look in to.
Lions and Tigers and more EJB, oh my!
I signed up for a bunch of EJB presentations because that’s one of the areas where I’m most behind. Holy shit was this a mistake. With the “Java Blueprint for the Simplified EE5 programming model,” they definitely started repeating themselves. I couldn’t take twenty minutes of this before I had to bail. Oh well.
May 18th, 2006 at 7:26 pm
Let’s see, where to begin.
I’m not clear on why interceptors are being added to the J2EE spec. JBoss used them to implement the old J2EE, and frankly I expect that most J2EE servers did under the cover (although I think JBoss was the first to do it at runtime through reflection, which always shocked me).
I wish people would stop talking about aspect oriented programming and start talking about meta-object protocol or some such. The old terms made more sense to me.
As for Groovy…. I’m still not sold on it. BeanShell always seemed to me like a great solution and I never understood what Groovy offered that BeanShell didn’t (or that couldn’t be added to BeanShell very rapidly). It seems like Groovy : BeanShell :: JDK 1.4 logging : log4j.
May 19th, 2006 at 10:01 am
You smalltalk guys are funny ;) The AOP (sorry for using the infidel terminology) stuff is well and good. It’s the NIH that bugs me. Robert said that Spring was in some way (I forget) just using AspectJ instead of reinventing the wheel. This is a good thing.
I can explain Groovy pretty easily: it uses language features of (currently) popular languages. Also, it’s targeted more as an application development language than as just a scripting language (which I get the sense that BeanShell is).