Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static utility methods

 
peter brews
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic