OSWorkflow: Incompetence run amok
Monday, July 7th, 2003Alright, just so nobody feels that I’m biased, I’m going to rant against one of my own projects (although I will cleverly place all the blame on someone else, but nobody’s perfect). Today’s winner is OSWorkflow.
First, a bit of background. Many moons ago Patrick Lightbody discovered opensymphony, and decided to be an active participant. He was/is an eager kid working at Cisco at the time, on some document management/workflow tool. He wanted to abstract it a bit and contribute it to opensymphony. Many of the core developers were rather lukewarm about the idea, but I was enthusiastic and eager for a decent workflow solution so I egged him on.
Thus was borne OSWorkflow (oswf from now on for the sake of brevity). The code was functional, sort of. I didn’t get too into it and used it for very trivial scenarios where it worked quite nicely. At the time it was EJB based, but when ofbiz became fashionable that soon evolved into a persistence abstraction layer and now supports ofbiz, hibernate, jdbc, memory, blahblah. All very nice.
The code however, oh the code! Now, Pat is a nice enough chap, and has many fine qualities. Unfortunately he’s quite defective in a couple of rather key areas. Nothing too serious, just…well…writing performant code, short concise methods, and anything that scales. Beyond these 3 shortcomings, he’s a talented fellow.
The real problems started when I foolishly decided to use oswf for a trading system that was expecting mildly non-trivial loads. Nothing too serious, just more than one a second. This turned out to be a ludicrous high load for poor oswf. For one thing, it made the ‘copy a propertyset (one query per key, plus another to get all keys) from the database into a map for every invocation (plus then persisting the map back to the propertyset)’ approach look quite…silly. Certainly an interesting approach though. Very pretty from the design view, to be fair. Just worthless in real usage.
Now, since oswf allows you to write custom classes and plug them in for things like validators, functions, registers, and so on, Pat decided that it’s worth having a class cache (as a static Map!). I guess nobody bothered telling him how classloaders work.
Worst of all, and this truly pains me because it’s STILL there (the previous issues have all been somewhat fixed), is the unhealthy obsession with statics. Frankly, any web/j2ee container should simply refuse to load any classes that have a non-final static field. It’s an insult to all that is holy. It makes me want to chew off my arm just to distract myself from the horrific psychological damage that seeing ’static’ does to any sane person’s psyche.
Still, why be so picky about the code? Pat is famous for changing things and then offering to maintain them, and winning by dint of insisting that he’s the only one doing the work so he should change it so life is easier for him.
A brief rundown of some of his party tricks over the last year:
Alright, now for the disclaimer. I like Pat, he’s a nice guy, and best of all, he’s learnt from all his mistakes and gladly admits he’s done some pretty dumb shit. He also suggested (well, mentioned once in an offhand comment) that I should beat up on oswf, so this is all his own damn fault. He’s also eager and enthusiastic and has that cheerful go-getter attitude that delights fellow Americans and rubs most Europeans the wrong way. Plus he has a sense of humour I hope so I can say all this without him removing my commit access.
Sadly, I have somewhat of a ‘once bitten twice shy’ problem now. Thus, I am avoiding xwork/webwork2 (which Pat is involved in, with a bunch of other people with their own dubious claims to fame) for the time being. I’ll wait until some other sucker finds out it performs badly/doesn’t scale/goes out of its way to spite existing webwork1 users and fixes it. Then perhaps I’ll grudgingly climb onto that bandwagon and get annoyed enough about it to fuel another rant.