I think someone finally got a web framework for Java right.

While I’m still yet to try on some of the AJAX support – something that makes or breaks a web framework these days – Wicket‘s clear separation of concerns and robust architecture for MVP (right, ‘P’, as in Model-View-Presenter) has really impressed me.  Generally speaking, I have not been one to embrace convention over configuration in frameworks like RoR, simply because it seems non-scalable.  But given it’s pure focus on UI and it’s total flexibility to do whatever the hell I want with my middle tier, I’m feeling that when restricted to the presentation layer – the paradigm works.  Wicket is pretty programmer-centric, so unlike RoR, you’re not going to get off the ground without some skills or a scaffolding framework like Wicketopia, but I’m not at all convinced this isn’t a bad thing.

There are a couple of things that I could get enthusiastic with around Wicket, were someone – including myself – to improve them.

  1. Documentation. Look, I hate documenting things as much as the next guy – but in as much as I’ve enjoyed the fruits of my labor in Wicket, I have not enjoyed chasing down information to all ends of the globe.  I love the fact that this is working software, and the curve isn’t too steep – but try finding stuff on form validation, or the entire concept of mounting URL paths.
  2. Callbacks, anyone? So, forms in Wicket generally appear to be processed by the onSubmit() method of the Form class.  You override this in your child class of form.  This is the very object-oriented way of doing things, but it seems a touch limiting out of the box to not be able to register callbacks on this method.  My Form class exists so that I can have more than one of these per page, no doubt (take THAT ASP.NET), but I still think that I’d like to be able to actually register callback handlers as I wish in each Page, thus allowing Forms to have different behaviors dependent on where they are used.  I’m pretty sure this isn’t the 80% use case, but I still am left with only one alternative out of the box, and that’s to keep extending the class hierarchy.  It’s nice to embrace strategy pattern and all, but to me this is where we really need an observer.

    So I was able to fudge this myself by creating a FormSubmitListener interface, subclass Form and implement it’s onSubmit() to call the formSubmitted() method from my new interface, it’s own implementation registered through the constructor on my Form subclass – but I think in an MVP or MVC framework, I still would like the ability to use OOP to handle the quirks of the page lifecycle (yeah, yeah – Wicket is unmanaged), but allow observers to actually handle pseudo-user events.

These two things aside, I feel pretty at peace with Wicket as my web framework for Java projects going forward (sorry Seam).

Another note – I’m really interested in the possibilities of packaging all of the resources for the web project in the JAR file.  While WAR’s are fine for deployment, JAR’s make the application open for truly modular design.

Now to refresh my memory on getting JTA running in a pure servlet container…