Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Friday, October 27, 2006

A step back from the bleeding edge

In an earlier post, I blogged about my gamble with using AspectJ. Well, I've been having Eclipse performance and stability problems for a while now, as I've upgraded Eclipse from 3.1.x to 3.2 to 3.2.1 and kept updating my AspectJ plugins. I've had issues with Maven and AspectJ, especially with Corbetura and AspectJ.

For what? Some clever defensive programming ideas (automatic null checking of parameters), a little bit of concurrency help, and a few additional cases.

Much as I liked the automatic null checking, I found increasingly that I was supressing it (with a special annotation) in many cases. In fact, the most useful place for such checking is in bridge code between user application code and the public Tapestry API ... and that's really not a lot of code.

The concurrency support was nice, but expensive. I found that in most cases I could convert to using copy-on-write, threadsafe collections instead. For the couple of cases where I couldn't I put together a utility class to manage the reentrant read/write lock on behalf of other code.

So ... goodbye AspectJ (for the meantime). Positive improvements: shrunk the size of the JAR by about 30% (657K down to 449K), plus no runtime dependency on AspectJ. Everything's running great. No problems.

Dissapointing. AspectJ still has a raft of very important uses, but the cost (in terms of developer frustrations) outweighs the benefits, at least for nice clean, new code like the Tapestry 5 code base.

6 comments:

Massimo said...

As i see you already merged back in to trunk, that's great!

BTW i think even a performance boost could be gained by this 'patch'.

Amazing great work Howard!

Unknown said...

Possibly faster code, but that's because its doing a lot less (not constantly checking method parameters for nulls). That's a good thing until we get the first bug that says "I passed null to Foo and got a NullPointerException instead of a useful exception".

Anonymous said...

How are people commenting on your version 5 code, I did not think it was available to public?

Unknown said...

It's being developed at Apache; go download it. There's a few Maven-related hiccups on the home page w.r.t. getting the source, but if you can navigate using Subversion, you can pull it down and build it yourself. Go have fun.

Everything is public at all times, no problems. For the moment, development is basically single-threaded (me) because I think that works better at the start of the project. That phase will end soon!

Anonymous said...

Not seeing any reference to version 5 on http://tapestry.apache.org/download.html or any of the sites listed on http://www.apache.org/dyn/closer.cgi/jakarta/tapestry/

Unknown said...

The tapestry home page is http://tapestry.apache.org. There are links from there to Tapestry 3, Tapestry 4, Tapestry 4.1 and Tapestry 5.

Download of the JAR is by Maven. It is alpha software.