• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SSB vs. Simple Java Class

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am in a situation where I need to design an adapter for some process. The major deciding factor is the performance.
I was thinking about imlementing the stateless session bean but someone suggested that if we donot have any transactions we should go for a simple java class with all static members, this would be more efficient than using SSB.
The suggestion was backed by a good explaination that the 2 most CPU intensive tasks are instance creation and garbage collection.
Using a java class with all static members would, however, mean no to OOPS !!!
Any thoughts agaist this or in favor of this are welcome.
Thanks,
Harpreet
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I always think of design choices between EJBs or not is that the EJB is deployed within an EJB container. This container provides implicit middleware services such as declarative security, transactions, etc. Obviously, business logic which does not require middleware would be more suited for a simple java class.
By choosing a java class with all static members is obviously your perogative, however, I sense that performance is such an important issue that instantiation and garbage collection is mandating your design choice, I would suggest C++ and/or C which are for most part, faster than Java in performance tests.
 
reply
    Bookmark Topic Watch Topic
  • New Topic