Stupid People code EJB

After so many years of coding in Java, I’ve finally decided that almost universally, stupid (or ignorant) people code EJB’s. Almost every piece of EJB code is nothing more that a data-access layer. Why on earth would you willingly incur the expense of 15 additional stack layers for each call, and the expense of marshaling and marshaling the parameters of each of those calls?

Why? Because then you can load balance the data-access layers across multiple machines.

Except.

Databases do load balancing by themselves!

The intention is generally that the business layer will go in the EJB’s and the web / fat-client layer will be a very thin layer that does calls to the EJB’s. Except it almost never works out that way, because most coders are simply to lazy, or figure out theres a huge expense in doing it that way as well (you  wind up overloading your network / internet connection with UI related calls). Although with a fat client I can understand the use of an EJB in this way.

So all you ignorant / stupid types, heres what to do:

  1. Either integrate you EJB’s into your GUI code base and be done with it.
    1. On a small project, this actually makes things more manageable
  2. More more of your business logic into you EJB’s
    1. Changing a users email address on the EJB should send the confirmation email and wait for a “confirmAddressChange” sort of method.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: