• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Perils and Merits of EJB

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone give me a good reference that discusses the perils and merits of EJB?
Here are the merits of EJB that I am aware of:
(1) Performance (anybody have some benchmarks? David Chapell in his recent talk at Softpro Books in South Denver said the Sun PetStore example could be implemeneted much more efficiently without EJB).
(2) CMP (container managed persistance) is very nice -- but is anyone using it?
(3) BMP (bean managed persistance) -- what is the merit to this approach? Why not just use JDBC?
(4) Role based security is implemented for session and entity beans.
What are the disadvantages?
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, here's my 2 cents...
(1) Performance is one of those issues that keeps cropping up again and again. Some camps say that EJB provides fantastic performance, while some don't. The reasons against are because EJBs are relatively heavyweight, container managed components that require a fair amount of resources. On the other hand, containers (depending on which vendor you choose) can optimize things by pooling bean instances, providing caching for entity beans and so on. So then, is performance a merit of EJBs? I think so. Scalability is also one of the best things about the stateless session bean model.
(2 and 3) Despite what people say, CMP makes building entity beans very, very easy. BMP is great, and IMHO, a better way to build truly portable entity beans - simply because you don't have to rewrite the deployment descriptors for each server. On the projects that I've been involved in, we've usually used a combination of CMP (for the straightfoward O/R mappings) and BMPs (for more complex stuff). In addition to this, we also use patterns like Data Access Object and Value Object next to entity beans when we need to read large amounts of persistent information. This hybrid approach means that we get high performance reads, while still maintaining the nice abstraction layer for small reads and updates.
(4) Role based security is great, although since the majority of systems will have a web-based interface built using JSPs and Servlets, you may find that you never actually need to use it, but rather handle this in the web tier. Even so, having the ability to control who accesses beans and their methods is a very powerful feature.
Anybody else have any thoughts?
Simon
 
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes! People are using EJB.
EJB is getting more useful.
Check out this posting...
EJB is useful and getting even more so!
Re:
"CMP (container managed persistance) is very nice -- but is anyone using it?"
CMP/CMR and EJB QL are very productive.
Check out this 4 part tutorial that is on developerWorks. Here is a site that explains the 4 part series....

4 part series on EJB 2.0 CMP/CMR and EJB QL
[ June 27, 2002: Message edited by: Rick Hightower ]
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are something like 5 things that EJBs offer (depending on how well my memory is working!)
1. Remote Invocation
2. Single-threaded interface
3. Transaction Management
4. Caching
5. Clusterability
My general rule is if I need at least 3 of them, use an EJB - the advantages of a predebugged system outweigh the expenses. If not, go for something lighter weight.
Choices are good!
 
Siegfried Heintze
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>
> There are something like 5 things that EJBs offer (depending on how well my memory is working!)
> 1. Remote Invocation
Is EJB better than RMI or SOAP?
Is this a non-issue for web-applications?
> 2. Single-threaded interface
If I have a web server like Tomcat calling my bean thru JSP, will I get a single threaded interface that is just as effective?

> 3. Transaction Management
Yup!
> 4. Caching
Is this exclusively and specifically a performance issue?
> 5. Clusterability
What does this mean? Does it mean that I can have two network nodes/CPUs sharing a drive and if one goes down the app continues to run on the other CPU?
 
reply
    Bookmark Topic Watch Topic
  • New Topic