Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Utility Classes in EJB

 
Thomas Andrewsen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


regards,
Siva
 
James Kesari
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont write it as a Session bean , simple Java class would do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic