IMO, Container managed Entity beans provide a quick and dirty solution. The server manages the persistence of your object and transactions. So its easy to get a simple EJB app up and running for Demo, or have something to show to mgt or clients quickly. This may be good enough if your over all app is not very complex. EJB does allot of the work for you and makes it quick to deploy, but if you have tons of data and scope creep where that you get more beans that have to cooperate, the overhead can adversely affect your performance. Bean managed persistence gives the programmer more control over the persistence. So if you need more control you can go that way, its 20 to 50 % more code (depending on the size of your classes - if you have a tiny class that's mostly data with getters & setters but not any long methods, the DB code can double the size of a class).
One thing that you want to keep an eye on while your modeling, is to model your major processes as Session beans which act as controllers, entity beans as model, then servlets or java applets or whatever as your view. I have heard tell of shops who put too much control in their entity beans. When scope creep happens, the entity beans then have to cooperate directly among each other (without session bean controllers). When you combine model and controller - Performance, maintenance, extensibility, transaction boundaries/scope, ability of anyone who didn't write it to understand it, sales, all goes rapidly downhill. "Nahid, Nazneen (CORP, Consultant)" wrote: > > Greetings everybody, > > I have been involved in developing Web Application in Java . > All the web applications that we have used are based on java classes and the > jsp. > Even our database connection pooling are based on the concept of simple > threads and classes. > > I have an oppurtunity to design an new Web Application and I would like to > give it a pattern and strong foundation. > > Question is :- What is the advantage of using EJB over simple Java Classes? > > I have got lot of documnetation, but I am in search of a simple question why > do we need EJB over simple Java Classes? > I may sound stupid but would appreciate an answer. > > FYI- the Application server is WebSphere v3.5. > > Thanks > Nazneen Nahid > > To change your membership options, refer to: > http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm
