The future & J2EE 23 Nov, 2003
There’s been plenty written about the future of Notes: Workplace, Websphere, J2EE being the way forward, etc., etc., etc. I’m not as curmudgeonly as others on the subject of Java (just kidding Andrew, I know you like it really), but it’s by no means the perfect language (you’re a fool if you think you can find such a thing). I follow a pragmatic school of thought that says find something, learn it, and make it work for you. That’s not to say I don’t have the odd whinge along the way, but of course J2EE != Java, and the former is a nasty beast at times.
From the general furore surrounding J2EE — particularly in Domino circles — it’s refreshing to read Charles Miller’s take on one particular aspect of the platform that drives him nuts:
It seems it’s impossible, these days, to write a decent-sized Java application without becoming reliant on fifty different library Jar files… On one hand, this is great. It’s great that Java has such a vibrant culture… It also makes for frustratingly fragile applications."
For many Domino developers starting out with Java, I think it’s amazingly difficult to build something rock-solid. We come from a world of RAD, which is remarkably forgiving, even if we don’t always think so. As a recent poster on the LDD said, “
Does x = x+1 have to be this hard in Java?”
Returning to Charles’ point, what to do? J2EE isn’t going away, and the current state of play so admirably encapsulated by his post is here to stay too.
So here’s my outlandish notion, as an arrogant newcomer full of piss and vinegar:
Code re-use is all well and good… it’s a definite plus-point for OOP, and I’ve spouted about it most fulsomely in an as yet-to-be-published — possibly never — article for e-Pro Magazine.
I believe in the concept passionately, yet it’s really one particular element of code re-use that I like to focus upon: take an idea, be it a single routine or whole application construct, and code it as elegantly and as (reasonably) loosely as possible. Whether you use someone else’s library or roll yer own is largely irrelevant, just so long as the application — and your approach to it as a coder — are not compromised unreasonably.
If your approach is to take one or two lovely ideas expressed well in an otherwise cumbersome open-source JAR file, then do it. Take the code, and bend it to your own nefarious will. If you’ve read about a nice-sounding pattern in a book, code to it.
Sure, you could scour the ’net for Yet Another Library to import, but I would argue that for 90% of these occasions, by the time you’ve found some code, tweaked the source formatting to your liking (be honest, you do this don’t you? Please say you do…), re-named some variables and removed some of the irrelevant stuff, you may as well have started from scratch with something of your own (OK, p’raps nicking a few ideas on the way).
What think ye? Am I evil beyond all hope of salvation? Or just a silly arse?
Update: Doh! Doing some surfing today, and what do I find? A good post about JAR file organisation and so forth courtesy of Richard Spence (AKA “Spuggy” I believe!) Look for the post entitled J2EE: Of packages and script libraries —
his permalinks are broken. Link now works!