• Post Reply Bookmark Topic Watch Topic
  • New Topic

SSB vs. Simple Java Class

 
Harpreet Hira
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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
 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!