Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes EJB and other Java EE Technologies and the fly likes To EJB or not to EJB (II) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "To EJB or not to EJB (II)" Watch "To EJB or not to EJB (II)" New topic

To EJB or not to EJB (II)

Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
I have a stateless Session Bean that needs to call another java class. I am currently thinking if I should implement this other java class as a normal java class or as an EJB. So I wondering what are the advantages and disadvatages asuming if this java class will always be local (i.e. never remotely called)

Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Alton,

I guess it depends. First you have to look at your class from a designing perspective. What are the responsabilities of this class. What are the relationships or associations with other classes in your system? Does it provide implementation for any of the use cases? Should this class be exposed to remote clients as well? On the other hand if this is only an utility class, I can see any reason why to make it an EJB.

I think, therefore I exist -- Rene Descartes
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
You might want to check out this article.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
Good article

Drinking more tea is the key...
I agree. Here's the link:
subject: To EJB or not to EJB (II)
It's not a secret anymore!