Archive for May 2007

Early JBOSS-Seam Impressions

In the last couple of years I’ve been pretty down on Java and web based applications, sure you can do it but it was torture and honestly who thinks JSP is a good idea, hopefully nobody. There was JSF but it seemed fairly disconnected from the server, and although J2EE was an improvement over its predecessor, it was heavy, verbose and not very orthogonal, plus there was lots of plumbing to do with respect to your DB. Finally, lets not forget those damned XML files and no matter how good your development tools were you still needed to keep a bunch of crap floating around in your head to do basic day to day development, it was easy to spend as much time on J2EE infrastructure than it was to actually worry about your app and its business logic. I’ve never spent any time with Spring or Struts so please forgive me for not going off on them as well.

So, enter Java EE and Seam, my interest has been rekindled in Java and Java based web applications. The simplicity and power of Seem vaguely reminds me of ObjectSpace’s Voyager, a truly revolutionary product for its time. With the introduction of annotations much of the configuration has migrated from the XML files to the source, all in one place, very nice. So far my productivity has been pretty good and enjoy writing Seam apps so much more than J2EE apps, suddenly Java enterprise programming is fun again. To say Seam is deep is an understatement, every new project I work on and I’m on my 3rd, pushes ome into new territory and Seam has a solution where many other frameworks force you to use a single approach, Seam often gives you several methods to do the same thing (sometimes too many, but that’s a different story.)  The learning curve can be rather steep at times, but in general it’s fairly easy to get something put together and working it’s the polish that usually requires the real work. As more people use Seam the knowledge base will grow and we’ll see more books and articles written.

I’m slowly on my way to becoming a Seam evangelist, I’ve already given 3 one hour presentations on Seam and its power. If Seam isn’t on your radar, check it out, because I’m confident you’ll be hearing a lot more about Seam in the coming year.

Seam’isms @RequestParameter

Seam has the notion of passing a Request Parameter to a class, but there’s a catch, depending on how things are being done (and there’s nothing to say I’m doing it right) @RequestParameter isn’t quite as flexible as I think it should be.

First you can’t set the parameter programmatically since the Request Parameter declared will always be set when hitting the page, whether it is passed or not. As an example, if you set the parameter via a setter method, the parameter will be reset to null if no parameter is passed via the URI overwriting the previous change. Not the use case I’m use to, it would be nice to have an option for RequestParameter to ignore the setter when no parameter is present. Something like:

@RequestParameter( ignoreifnull=true )

The always topical Software Security post

This is a good review of “19 Deadly Sins of Software Security“, too bad it’s not free on Amazon.

There are also some good links to other security resources in the post.

PyUnit Annotations

This is nice PyUnit add on for using annotations with your unit tests.

You can now annotate a method with @Test which frees one from being forced to use the naming convention ‘test’ in the method name like: def testSomething(self)

The other annotation that is really nice is @expected_exception(SomeException) which you normally have to set up a test harness to explicitly catch the exception and test for it, very nice.

Get the recipe here