20050917 Saturday September 17, 2005

More on Annotations in JSF

During the last few days, the JSF community seems to be collectively turning its eyes towards annotations. Duncan Mill blogged about it as a response to Ed Burns' blog and a discussion on TheServerSide.

The whole idea of adopting annotations in JSF definitely makes a lot of sense. First of all, annotations and wide addoption of IoC/dependency injection came about at approximately the same time. JSF has always supported the idea of IoC and dependency injection to some extent, and Shale takes it even further by adding support for Spring. It seems only logical that it would only be a matter of time until the JSF community would turn their eye towards the other software trend that crossed the chasm. Apart from that, almost all of the latest JEE specs are considering annotations, so why would JSF be any different?

An application of annotations in JSF that hasn't been mentioned yet is using annotations to configure validators and converters for backing bean attributes. I would love to have that, and it probably wouldn't be hard to do at all. Simply define a couple of annotations that map to the standard validators and converters, add them to your backing bean and rely on JSF to tie all of the relevant objects together at runtime. It would certainly ease development of the JSP pages. Apart from that, it seems like better object oriented design to keep the knowledge about the meaning of attributes with the object, instead of embedding it in the presentation components layered on top of that.

( Sep 17 2005, 04:12:45 PM CEST ) Permalink Comments [1]

Cleaning Up the Attic

Once in a while, I all of a sudden run into projects that I haven't touched for ages. Today I had such an experience. While thinking about a way to pretty print DTDs using XSLT, I realized that it would be impossible to have word-wrapped comments without either using some very complicated XSLT constructions, or a dedicated XSLT extension. EXSLT doesn't really provide anything that I can use out of the box, and apart from that, EXSLT is not entirely implemented in Xalan.

When I thought about a solution, I suddenly realized that - more than a year ago - I had been working for half a day on something that might come in handy now. If stuff is hanging around on your hard disk for over a year without ever being touched, then it's definitely ready to be either open sourced or to be moved to /dev/nul. I decided to go for the former option, so I quickly added some LGPL references and Copyright statements and uploaded it to the Web, just a minute ago.

Just see for yourself if it comes in handy. I of course do not accept any responsibility whatsoever for any damage this tool does to your products or customers. (I would however be curious to find out what it is :^)

You can dowload a binary version of the Xalan extension here. I will package the sources in a day or something. (It's just one source file, so it can't be that hard...)

CC-GNU LGPL
This software is licensed under the CC-GNU LGPL. ( Sep 17 2005, 03:22:59 PM CEST ) Permalink Comments [0]