I've finished composing my "Java Web Framework Sweet Spots" document and presentation for tonight's BOF at TSSJS. Unfortunately, the BOF is at 6:30 and Crazy Bob's wedding is at 6. So I won't be able to make it to the wedding, but I do hope to have a toast to Bob and his new bride. I have been successful in securing beer for the BOF, so you'd better get their early if you want a free one. Caesar's doesn't have kegs, so it's $6/beer and we've purchased 100 of them for attendees. After that, it turns into a cash bar. Thanks to Virtuas, Codehaus, SourceBeat and yours truly for pitching in for the free booze.
My presentation tonight will be short and sweet. Rather than going through each framework author's responses, I'm just going to highlight their "sweet spot" responses. This allows me to get away with creating a measly 8-page presentation, as well as have a more interactive session. I've taken everyone's responses to the 6 questions I asked, and compiled them in a document. This document is available on the Virtuas site, just click on the link below to download it.
» View Java Web Framework Sweet Spots
I'm sitting in Jeff's talk now, getting ready to listen to him ramble on about Geronimo. The room is about half full, and it's one of the smaller rooms. However, people are still streaming in, and it's the furthest room from the main conference area.
Jeff started his presentation with a little "Open Source Arcade" fun. The cartoon depicted a pac-man game with JBoss and Geronimo and resulted in a loud applause from the audience. This talk is going to cover Geronimo's architecture, how to use it, how to configure it, what it doesn't have and address common concerns.
Geronimo is a conglomeration of best-of-breed open source projects. Rather than reinventing the wheel, Geronimo embraces and reuses other open source projects: Axis, MX4J, ServiceMix, Spring, ActiveMQ, Jetty, Tomcat, Derby, Tranql, Apache Directory Server and OpenEJB. There's many others, but these are the headliners.
Geronimo is a carpet roll. Just like a carpet, it allows you to roll-your-own application server. Rather than using all the pieces of J2EE, you can just pick the ones you need? Currently, Geronimo ships with a collection of pre-configured assemblies: j2ee-tomcat-server, j2ee-jetty-server, minimal-tomcat-server and web-jms-tomcat-server. The last two will be available in the 1.1 release. The nickname for minimal-tomcat-server is "Little G".
Why another J2EE application server? Because J2EE is now a commodity. You used to have to spend a lot of money for J2EE servers. Now open source projects have commodotize J2EE and flattened the landscape. Also, the other application servers are LGPL and Geronimo is Apache Licensed, which is much more friendly to businesses.
Geronimo isn't just an application server, but also a top-level apache project with a healthy and active community. There are many other components coming out of this project, including:
- The Geronimo API/Kernel/Assemblies/App Server
- GBuild - Open Source Testing
- DevTools - Eclipse Plugin for Geronimo Application Development with the Web Tools Platform (WTP)
- J2EE Specifications - open source versions, eliminating the jta.jar problem you get with Maven. In my experience, most of these work, but Geronimo's javamail implementation doesn't work last time I tested it.
- Home for OpenEJB, ActiveMQ, ServiceMix, Yoko (Corba) and XBean - all stand-alone sub-projects.
The Kernel of Geronimo *is* what is known as Geronimo. It controls the component (GBean) Lifecycle. A GBean is the Glue, the Wrapper, a Plugin to the Kernel. It conforms to JSR-77, the J2EE Management Specification and controls lifecycle, running states and naming conventions. The GBean architecture allows for simple development - you just need to implement the GBeanLifecycle, declare the GBean in a Plan (IoC) and deploy it. Plugging in 3rd party components is easy - for example Apache Directory and Quartz. Jeff wrote an article showing how to do this.
Jeff is now walking through the directory structure, which is pretty standard:
bin
config-store
deploy
docs
lib
repository (similar to Maven 1's structure)
schema
var
If you're familiar with Tomcat, Geronimo's "bin" directory is very similar. There's startup.sh/.bat, geronimo.sh and you can also use java -jar ./server.jar to start the server. Apparently, many of the scripts were copied from the Tomcat project.
Interestingly enough, my MacBook Pro's battery has been *much* more efficient today. I've been running for about 2.5 hours and the battery says it still has over an hour left. I believe this is largely because I've had my airport turned off most of the day.
Geronimo's Web Console is one of the nicer looking consoles I've seen for application servers. The user accounts for this are set in $GERONIMO_HOME/var/security/users.properties. It was donated by Abock (sp?) and I believe it's built on Pluto. For deploying applications, you can use the web console, drop WARs/EARs into the deployer directory or use the deployer tool (deployer.sh). When using the deployer tool, you'll need to have a plan file.
A plan file is an XML document (external or internal depending on nature of plan file). It's a descriptor to extend your application (setup JNDI DataSources, etc.) and similar to jboss-web.xml and weblogic.xml. Embedded examples: geronimo-application.xml, geronimo-web.xml, geronimo-ra.xml. For external plan files, you can use any name for the file. This file describes the GBean's attributes and references, as well as its dependencies. There are many different types of plans to describe information: web, application, resource adapters, security, naming references, EJB, schemas (in $GERONIMO_HOME/schemas directory).
The $GERONIMO_HOME/var/config/config.xml is Geronimo's central configuration file and allows you to override default values, as well as configure (or disable) GBeans. However, you can use the web console to configure everything in this file - and often it's much easier.
Now Jeff is going to do a demo of deploying and configuring Roller on Geronimo. This should be good, especially since he expects Murphy's Law, "if something can go wrong, it will", to come into play. He's showing us the plan file and how he had to hide a few classes, to prevent Geronimo's classes from conflicting. Jeff tried to show us how Geronimo allows you to download JDBC Drivers from w/in the console. Doh! We're in a conference room without an internet connection. Jeff had a backup plan and was able to successfully create a connection pool. After creating a security realm, he deployed roller.war and it all worked.
What Geronimo doesn't have? It lacks full clustering with respect to EJB/JNDI/Distributed cache. It *does* have full clustering with session replication and fail-over for the Tomcat web component, which fits 90% of clustering use cases. Uses Tomcat Clustering GBeans. Also, it can't run with Java 5 (only with 1.4.2) b/c the Corba component doesn't work with Java 5.
Now Jeff is doing Q&A, so I decided to try out my connecting to the Net via Bluetooth. It's actually pretty fast, GMail is surprisingly fast. From Bandwidth Speed Test, here are my results:
Communications: 87.1 kilobits per second
Storage: 10.6 kilobytes per second
1MB file download: 1.6 minutes
Subjective rating: Slow
This is my 2nd day in Vegas and so far this town is treating me fairly well. I haven't lost all of my money, but the $25/hand blackjack tables haven't been kind. Yesterday, I woke up with a glass full of Berocca next to my bed - which means I passed out before drinking it. I needed it too, Matt Filios won a poker tourney and a bunch of us enjoyed "bottle table" (with Kettle One vodka) to celebrate. Spendy and good, but painful the next day.
Last night, I heard it was Crazy Bob's bachelor party, so I went to bed early to avoid the debauchery. Julie and a good friend of mine are flying in tonight, so there will be plenty of that this evening. So after a good night's sleep, I'm up early and attending the conference. The first hour has a lot of good sessions: Introduction to Seam (Gavin), Dive into RIFE (Geert), OSWorkflow (Hani) and Transforming Enterprise Java into a Commodity (Geir).
I'm sitting in Geert Bevin's session titled "Dive into RIFE" and it's a pretty small audience - maybe 20 people. Geert is the CTO of Uwyn, a small custom application development company. He's the founder of RIFE and creator of many RIFE projects: RIFE/Crud, RIFE/Jumpstart, RIFE/Continuations, Bamboo (forum), Bla-bla List (RIA todo list), Drone (Information bot) and Elephant (blog).
What is RIFE? It's a full-stack component framework to quickly and consistently develop and maintain Java web applications.
- Integrated layers allow you to quickly get results with a minimal amount of code
- Best practices are enforced in a pleasant way, providing many additional features and a consistent approach throughout all applications
- Components can easily be resused in many contexts
- Creating maintainable applications is our first goal
- A lot of attention goes to code-level developer comfort
- Frustration reduction by instant changes and reloads
- Creative solutions for difficult problems
- Embraces established standards (XHTML, HTTP, SQL, ...)
- Geared to developing web applications and doesn't abstract away too much
- Everything besides the web engine is designed to be independently usable
- Attention to the whole life-cycle of your application
Geer is now talking about all the different pieces of RIFE - how it has a JDBC abstraction like Spring JDBC, web services support (even publishing of RSS Feeds) and a content management framework. Now we're going to look at RIFE/Jumpstart.
What is RIFE/Jumpstart? It's a source archive that you unzip and run. It makes it easy to start with new RIFE applications and contains everything you need (including Jetty). It has immediate support for more common development environments (X-develop, Netbeans, Eclipse, IDEA and Ant). Geert just showed us a video of getting started with Jumpstart and how you can easily use X-develop to build and deploy the app to Jetty. The Jumpstart application currently uses JUnit, but since the RIFE teams is starting to use TestNG more and more, it's likely they'll change in the near future. RIFE Jumpstart looks similar to AppFuse, except they have the save+reload problem solved - using JVM HotSwapping.
Now I've moved to the Introduction to Seam session. Gavin King is the presenter and the room is packed. It's a big room, so that's saying a lot. Gavin is talking about JSF, how backing beans work and what's in the faces-config.xml. How does Seam compare to J2EE? Much simpler code. There's fewer artifacts (no DTOs). Less noise (EJB boilerplate, Struts boilerplate). More transparent (no direct calls to HttpSession or HttpRequest). It's also much more powerful for complex problems.
JSF is amazingly flexible and extensive. EJB interceptors support a kind of "AOP lite" and EJB3 is a powerful ORM engine. Everything (except for the JSP pages) is unit testable can be tested with JUnit or TestNG. For testing the view layer, Gavin recommends using Selenium.
A backing bean is often "pure glue" and is just noise. Furthermore, it accounts for more LOC than any other component. It doesn't really decouple layers, in fact the couple is more coupled than it otherwise would be. Gavin calls this "wedding cake architecture." These applications look good in the window, but don't taste good when you eat them. I get his point, but have to disagree on the taste of wedding cake. It's always been good at the wedding's I've attended. ;-)
By default, web applications in general do not work in a multi-window application. To make it work, it generally requires a major architecture change. A couple of other areas for improvement in traditional web applications: application leaks memory (not cleaning up session objects) and "flow" is weakly defined. Navigation rules are totally ad hoc and difficult to visualize. How can this code be aware of the long-running business process?
JBoss Seam - what does it do? It unifies the EJB3 and JSF component models. It simplifies Java EE 5, filling a gap. In addition, it integrates jBPM and makes it more developer-friendly. Deprecate so-called stateless architecture. Decouple the technology from the execution environment. Run EJB3 apps in Tomcat or in TestNG or use Seam with JavaBeans and Hibernate. Gavin is using Tomcat for the first time and thinks it's hot-deploy architecture is totally broken. Of course, he usually uses JBoss and never has a problem with hot-deploy. It's interesting to hear this from Gavin, especially since I've heard from others that Hibernate breaks the reloading - and it's not the server's fault.
I'm going to head to another session now, but I did look ahead at some of Gavin's slides. Interestingly enough, the jPBM pageflow definition's XML looks quite similar to Spring Web Flow. Speaking of flows, I heard an interesting comments from someone yesterday after they attended Geert's continuations talk. Apparently, after seeing his talk, they think that RIFE's continuations offer a much more elegant solution to pageflow than these "XML programming" mechanisms.
I tried to go to Hani's OSWorkflow talk, but he was doing Q&A when I walked in. Apparently, he finished 25 minutes early. Then I walked into Geir's talk only to find Dan Deiphouse finishing up an XFire talk. Oh well, there's nothing wrong with having a few minutes to mingle between talks.