asshat penis extender: json-rpc-java
It’s really astounding how easy it is to pull the wool over the java kids’ eyes and amuse them for hours on end by merely dangling a shiny object in front of them.
The latest example of this is the one of the ‘ajax’ poster boys, json-rpc-java.
I am truly baffled that people take this crap seriously. At best, it’s a cute toy with a couple of neat tricks that one could copy. At worst, it’s a evil evil implementation that’ll bite you in the ass if you ever expect more than 3 users or would ever like to cluster, use declarative security, fine grained access, method level anything in fact.
The idea itself is not that bad. The implementation however is almost like some kind of sick sick joke. For those who have so far been wise enough to avoid this shiny bauble, it’s basically a clever hack built around xmlhttprequest and some javascript to java serialization that allows you to invoke arbitrarily methods on serverside java objects.
So how is this done? For reasons best known to to the authors themselves (and no doubt applauded by the shit-eating-grin sporting ajax crowd), they basically bung everything into a session. Now, you might be forgiven into thinking that ‘everything’ here is just lightweight stateless information. You’d be so so depressingly wrong. Every means that each user gets their own JSONRPCBridge. This class is so incredibly session-unfriendly that it doesn’t even implement Serializable. Even if it did, mind you, you’d be even further up shit creek sans paddle. Said class contains every exposed object, every exposed method, and every exposed class. Persisting this to anything other than memory is likely to take a few days at best, while your hapless user is left sitting there with any number of thumbs inserted into any number of orifices. Adding to the general hilarity within this class, we also have a static classCache map. It’s the gift that keeps on giving!
Of course, should you to refuse to use said session object, you’re forced to use the ‘global’ bridge. Of course, when asshats like these say global, you just know they mean ’static’. Of course, of all classes they could have possibly stuck the static, which did they pick? Yep, you guessed it, the very object they’re shoving in the session!
The documentation of course is in the fine tradition of open sores. It starts off well enough, but halfway through the manual, the author simply lost interest in the whole thing and just gave up, leaving 4 sections totally blank. Just imagine the hue and cry if a commercial vendor dared have empty swathes in their documentation. Why on earth is such incompetence tolerated and nudgenudgewinkwink-ed away in the opensores world?
It’s quite a shame really, the project is a cute little gizmo, and to the authors’ credit, it has no dependencies and does not use maven, so they’re not completely braindamaged. They do try and go out of their way to make up for that foresight though by forcing their hapless victims to edit build.xml and specify twatty tomcat values. It is truly astounding how few people seem to know how to use ant, or how others expect to use it. The developers’ real downfall however seems to be that they were never beaten with the scalability mallet as children. So if you kids know what’s best for you, let the beatings commence!
March 23rd, 2005 at 9:29 pm
First!
March 23rd, 2005 at 9:51 pm
Why is it that since the thing has a name (”ajax”) _and_ some random TSSS guys caught up with the past and did a presentation on yesteryears technology, everyone has a big fat boner now? It seems that even the lamest idea and technology can be hyped, all it needs is a buzzword. EJB comes to mind. Webservices. SOA. ajax …
March 24th, 2005 at 4:03 am
A much simpler and quicker way to do this sort of thing:
http://eireneh.thorubio.org/dwr/index.html
March 24th, 2005 at 4:32 am
I am not quite sure but i think ajax is overhyped especially in the blogger world. You just need some guys pushing a technology who have descent blog traffic and you see thousands of other bloggers following without questioning anything.
I wrote my oppinion about java here:
http://www.logemann.org/blojsom/blog/default/?month=3&day=5&year=2005
But reading silly implementation limitations like these is even more disturbing. Perhaps i am too old to know that javascript will never be painless, no matter how big your JS library is to support different browsers. I recently searched for XmlHttpStream support on various Microsoft embedded OS like Windows CE and i can only say: “good night”.
March 24th, 2005 at 4:58 am
Well, Mr Bile, while json-rpc-java current incarnation is indeed lacking in many aspects, why don’t you startle us with your own wizardly implementation. Anything beside public masturbation will do.
March 24th, 2005 at 8:26 am
Marc: given that the name is XmlHttpRequest, it’s not surprising you couldn’t find anything. Doing a search at the MSDN library for “windows ce xml”, the page linked from the first result mentions support for XmlHttp in WinCE 3.0.
Oddly enough, that’s the first time I’ve ever got a useful result back from an MSDN search…
March 24th, 2005 at 11:31 am
Oh by the way. JSF sucks!!! (I think 3 years down the line, it will be usable)
March 24th, 2005 at 2:47 pm
Guys, I’m a little sick and have a hole in my chest, so I’ll be unable to wash any feet this year. I’m delegating that task to my hidden nephew, Bill Berk. Please refer all dirty feet matters to him.
PS: VII + XXXIX = XLVI right ?
March 24th, 2005 at 5:16 pm
Inta mahdoum ya habibi. Minoin hader tak?
March 24th, 2005 at 5:18 pm
Neko, yiiiiiiiiiiiiiii
March 25th, 2005 at 12:11 pm
Ha ha ha, awesome! Hani, did you get some sand in your vagina?
March 26th, 2005 at 11:24 am
Is this what a “shit-eating-grin” looks like?
http://xxxpunkrockerzxxx.tripod.com/sitebuildercontent/sitebuilderpictures/picture229.jpg
Just wondering…
March 27th, 2005 at 2:05 am
If nothing else, the title rocks.
July 18th, 2005 at 6:32 pm
I extended the servlet, and put that piece of shit bridge in the session on every request (constructed from my REAL serializable session information), and finally {} removed it from the session. Freakin ruined my cluster before I did that!