This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Static utility methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Static utility methods" Watch "Static utility methods" New topic
Author

Static utility methods

peter brews
Ranch Hand

Joined: Jan 25, 2002
Posts: 59
Dear All,
I have some utility method defined in my ejb bean class.
These utility methods accept parametres and return values.
I have lot of methods in the same bean class
which call these utility methods.
Could you please tell me what will be better solution performation wise
1. to define these methods in a seperate class and import that class in my ejb
2. to define these methods in the bean itself
3. whether to define these methods as static or not.
fro ex. 1.a have written routine to change format of date
2. i have routine to unescape certain chars.
Thanks,
smita
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
These utilities are probably better off in a general util package for your application. Presumably these utilities will be useful to other classes besides your ejbs.
peter brews
Ranch Hand

Joined: Jan 25, 2002
Posts: 59
Actually these utility classes will be used by the EJB only as i don't have any other classes .
if i define it in util package /class then i may have to create instances to accesss these methods.
should i define these methods as static or not.
thanks,
smita
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static utility methods