Why aren't we doing more of this in Java?

13 August 2003

Our work application uses an EJB tier to tie the whole thing together. Actual business logic is implemented in the database as stored procedures, and my session beans are only there to call the procs.

They explained to me that everything is in the database to provide finer control of security, and obviously, for performance.

Having all the logic in the database allows me to avoid coding much of the real work, but having been forced to look at the code for some of these stored procs, I don't know how you can keep your thoughts straight. To do anything you must SELECT from somewhere even though you're not actually pulling any data from the db. It's insane.

A favorite example of a scary proc is 3376 lines of actual code (no whitespace or comments), and 673 of those lines contain the word "SELECT".

It just doesn't look like code you can actually maintain. I could code it so much clearer in Java, and when I need to boost the performance, I can start transparently splitting the business logic across a cluster of application servers.

It's too bad I can't make this project my proving ground for super-scalable Java code. I guess I'll have to grow my personal projects into beasts like this. (I did at one time have wedding.hjsoft.com split across 2 machines just to see it.)

Filed Under: Work