Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

class with all static methods Vs a stateless SessionBean  RSS feed

 
ravi thupil
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't we prefer a class with all static methods instead of stateless a SessionBean? I think a class with static methods performs relativly fast instead of stateless session beans?
Thanks in advance.
 
Sid Vicious
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about remote access to this class? Do you keep a copy
on every server and how are these kept in sync? You could make
it an RMI class and register it that way but you might as well
use slsb's. If the system is configured correctly and code
written properly, there shouldn't be perf issues with slsb.
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm relatively new to EJB's, so someone corect me if I'm wrong.
If you make the class static, then you can effectively have only one instance of the class. I would guess (can someone confirm?) that the EJB server probably won't know that the class is static, and may try to create multiple instances of it (unless otherwise directed not to in the configuration files). This would probably result in concurrecny problems.
--Mark
hershey@vaultus.com
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!