wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Utility Classes in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Utility Classes in EJB" Watch "Utility Classes in EJB" New topic

Utility Classes in EJB

Thomas Andrewsen

Joined: May 26, 2006
Posts: 7
Hai All,
In an EJB server side module, if there is small utility class is it advisable to write it using stateless session bean or as a normal java class. If it is a session bean the class cannot be reused anywhere else and if it is a normal java class it will not get the effeciency of Session Beans(pooling etc) but i can reuse it anywhere.


Thomas Andresen
James Kesari

Joined: May 18, 2006
Posts: 16
If it is a utility class why do you need pooling?
Utility classes are generally static methods / Singleton, depending on the usage.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

Dont write it as a Session bean , simple Java class would do.

It is sorta covered in the JavaRanch Style Guide.
subject: Utility Classes in EJB
Similar Threads
statefull session bean
EJB-2 Doubts -Traeting session bean as a class
Data Access Beans
Business Delagate - Session or Java class
To EJB or not to EJB (II)