Let us establish one undeniable fact: enterprise programming is hard.
Sure,
Servlets are superb at handling client requests, and Java Server Pages are fabulous at generating markup for a client, but request-response programming is not where Java developers earn their salt.
Java developers earn their salt by implementing some seriously complicated business logic. Fiddling with a Servlet�s request and response objects all day long won�t impress anybody.
Enterprise programming is hard, but EJBs make some of the toughest parts of enterprise programming just a little bit easier.
What are the common challenges enterprise developers encounter?
Enterprise programming is hard. In an enterprise environment, there are a number of mission critical challenges that must be addressed and implemented properly, otherwise applications will fail.
Some of the typical challenges that enterprise developers encounter include:
Database Access:
How do we ensure that that data in our application is completely, totally, 100% in sync with what is in the database? This is a requirement of almost every enterprise application, but without an intimate knowledge of how a database works, implementing database synchronization properly is a significant challenge.
Transactional Updates:
If I'm updating three different databases in an �all or nothing� type of scenario, and one of those database writes fails, how do I roll back writes to the other two databases?
What if one of those databases is in Kalamazoo and two of them are in Tuktoyaktuk? How do you maintain the transactional integrity of your updates?
Distributed Programming:
I'm in Gun Barrel, Texas, but I want users in Antigonish, Nova Scotia to remotely invoke the methods in my Java components. How do I make a local component accessible to remote applications?
Multithreading:
Multithreading remotely accessible components that must handle a gargantuan load is a difficult and onerous task. How are you going to do it?
Secure Access:
You only want Double Agents to call one method of your JavaBean, and only Secret Agents can call the other method. How ya gonna do it? With a typical Java application, it�s almost impossible.
How do EJBs Make Life Easier?
Database concurrency, distributed transactions, multithreading, distributed programming and secure accesses are all issues our enterprise applications must deal with.
If we have to deal with these issues alone, we�re going to be in an ugly world of hurt. The good news is that EJBs deal with these issues, and by dealing with them, they make enterprise programming much, much easier.
I hope that sheds some light on ejbs. More here:
http://www.technicalfacilitation.com/get.php?link=usingejbs [ August 27, 2006: Message edited by: Bear Bibeault ]