13 May 2007

JavaOne wrap-up

It was a long travel day yesterday to get back to DC. Here's the rest of the

Things I learned:



Glassfish 3 has a really neat-sounding architecture. The app server core is like a 20K jar and launches in half a second. It then has a maven-based dependency system that causes it to load OSGi modules that add things like JEE container, servlet container, HTTP server, PHP support, JRuby on Rails (directly from the app directory - no WAR building), Phobos, etc. So you can add a number of containers to your one running Glassfish instance and then deploy apps into it. (I think Cargo is another way to do this.) It also means it's a pretty extensible app server. There's some nice classloader magic, with a public and private classloader for each module, to make all of this possible and avoid typical J2EE classloading nightmares. Also, their build scripts create configuration files out of annotations, as opposed to introspecting them at runtime.



Rod Johnson's talk was packed. I wonder if Sun intentionally gave him a smaller room than his popularity demands because they're not sure they like him undermining their EE specs. He is more like a corporate CEO than a coder - he's very driven and seems to want market share more than hacker credentials. Interface 21 got $10M in funding at the beginning of the week so maybe this gave him big britches. Spring is adding annotation support - he did mention Guice in passing. He's also certain that OSGi is the next big thing, Interface21 is working closely with them. There's a Spring-OSGi module with the implementation. Sounds like an important thing to go learn!



Tor Norbye of the Java Posse kicked some butt! Not only did he give a talk on his Ruby contributions to NetBeans, he also was up on stage in front of the entire show at the last general session ("Toy Show") and demonstrated his speed in Netbeans and the number of keyboard shortcuts he must know. I wonder, it looked like they were all presenting on Solaris boxes, and he codes on a MacBook Pro, so wouldn't the modifier keys on the keyboard be hard to find? Maybe he practiced... I did download NetBeans 6 and opened my RoR project in it - there are some nice things. I used the local history, completion, and navigation features, and they worked pretty well. The real issue with IDE support for Ruby is the debugger - in C, there are a couple debuggers, but there's no equivalent of JPDA that lets you remote-debug a running Ruby interpreter. For JRuby, someone is working on a debugger, but the Sun guys are pushing for contribution to the Debug Commons project which will help all the IDE's have a consistent way to invoke debug operations. They're looking for help - Gabe?



Hibernate Search looks like a nice union of Hibernate meta-data with the Apache Lucene search engine. You really can't do good search with Hibernate criteria - the LIKE operator in SQL is way too slow. I ran into this with a search application at my gov't client that tried to create a massive SQL query for every user search, which was a really bad approach. Hibernate search allows you to add some annotations to your JPA class to indicate what fields should be full-text searchable, then it handles building the Lucene index, and even keeps the index up-to-date if you change the entity. There's a JMS-based solution for clustered front-end machines to share a master Lucene index. And, extra nice, the Lucene search is wrapped in a standard Hibernate Query object so your DAO code doesn't have to know it's not using SQL for some queries. Nice! I did notice Emmanuel called something a "workaround" - this made me wonder about some of the Hibernate code and whether they've allowed that mentality to get into the codebase - but this looks like a really nice way to support user search in Java.



Selenium is a great way to automate functional tests of a web app. Unlike HTTPUnit and other Request-Response level testing tools, Selenium runs a true client within the browser. This allows it to work with Ajax apps, for instance. There's a Firefox plugin that records your interactions with the app and turns it into a JUnit test case - also very handy. Selenium gets its name from the element, because it's used as a remedy for Mercury poisoning. Man, Mercury has been a terrible vendor in both of my last two clients.



Chris Richardson (author of POJOs in Action) had a nice presentation on testing, most of which I already knew. But he had a nice way of expressing why good guys don't win when it comes to unit testing and TDD - the "paradox of excellence", which is where you are rewarded for fixing the nasty bug right before production (or in production, shudder), while you are not rewarded if things quietly work and you leave every day at 5.



Feeds and REST are the community response to the enterprising of web services with XML-RPC and SOAP. There was a great graphic on one of the slides from the Rails guy, David Heinemeier Hansson:


So true.. I went to a talk on WS-Policy and pretty much wanted to shoot myself after the barrage of consultant-speak and enterprise BS. So - feeds - Rome is the Java library of choice because it handles the mess of RSS and Atom formats (RSS never had a spec!), but it's JDOM based. Watch for it to merge with the Atom-only but STAX-based feed library (A-something...)

There's even an alternative to WSDL for the lightweight REST crowd - WADL. However, there are a lot of security issues lingering in this whole mash-up environment, basically, you should only mashup to sites you really trust like Google. Assuming the stuff about Chinese censorship hasn't put you on a crusade...



Domain-specific Languages are really great for solving some problems, and I started to think of them as an alternate solution when you consider a rule engine. Rules are good for implementing a lot of business requirements that would involve big chunks of repetitive, procedural Java code. But, a lot of times, those requirements aren't globally true facts about the business, they're very contextual and too simple, and there are too many of them, and a rule engine isn't a good fit. Perhaps you want to code the solution, just not in Java. You want a language that expresses the business concepts - aha! Now, the talk from another Interface21 guy went into implementation details for writing your DSL in JRuby, where it is easy, then easily integrating this with your enterpris-y Java app. Managers don't have to freak out since it's just another JAR dependency, but it's a much better way to create and use a DSL than any solution in Java (I don't actually know of any). I think this is a great addition to the programmer tool-belt. Also, this guy actually demanded a raise from Rod during the presentation, I guess the $10M has gotten to their heads... not sure I want to work there anymore.



My overall observations from the conference:

  • JRuby is going to make a major impact on Java development, both in the web and enterprise (I don't know about micro... but I think there was a presentation on that). Java makes some things hard to do, and getting new major releases into common adoption takes a couple years (still not on Java 5 at a lot of big companies!). So waiting 4 years for closures isn't going to compete with a single jar you can drop into your app to start including Ruby classes. I'm getting The Ruby Way, a recommendation from the JRuby DSL presenter.

  • It's important to work with smart people. Since they share a lot of common motivations, if there are a lot of smart people at a company, all your other criteria are probably met as well. I'm starting to think there are two distinct camps of brilliance, though - the artist type and the businessman type. Consultants seem to be the latter, and innovative ideas come from the former. Maybe you can distinguish them based on who has a Mac.

  • All of the good software companies are in the Bay area. I hope this isn't entirely true.

  • I want to go to JavaOne next year.

No comments: