• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to select the technology between EJB Vs Servlets

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am sure about how to choose the technology between EJB Vs Servlets for this given cases.

a) A scalable environment with very few transactions.

b) Very Limited users with more transactions.

Actually it is an Interview question. I have answered a) for servlets and b) for EJB's as in this case the EJB container will take care of the transactions. I am not sure about the practical usages.

Please share your views.

Regards,
M.S.Raman
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Data logic & Business logic
if ur application is heavy on data logic than the business logic in the sense that it handles huge data. But at the same time, it doesn’t involve complex business logics & doesn’t represent a complicated transaction system, it is better to go for servlets itself.

Network call with EJB
Internally, J2EE uses the Java Remote Method Invocation over Internet Inter-ORB Protocol (RMI-IIOP) to enable remote, distributed method calls and applications. While this approach provides benefits, it also generates a large amount of overhead, with a corresponding performance hit as stubs are referenced, parameters go through the marshaling process, and objects are tossed around the network.

Implementing middle tier services
EJB has a middle tier, which implements services such as instance pooling, transactions, security etc. The required services can be implemented in the non-EJB environment and tailored to the needs of our application with the required changes in the settings & the code without going for EJB.
Example:
Proper handling of objects, which makes Garbage Collection efficiently happening through out, user transaction etc.

EJBs are costly in terms of development.
We require having a set of deployment descriptors and Home & Remote interfaces. We require taking care of setting the right TX attribute for the business methods. And also, Deployment & maintenance will be costly in terms of time and resources.
In the case of java components, we don’t require to do what ever mentioned above.

But, when we have IDEs like WSAD, this point is not fully valid as these IDEs facilitate many things that we require to do.

Resource pooling without EJBs
Almost all major J2EE servers allow us to get connection pooling and thread pooling whether we use java components or EJB components.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Augg Stine:
Data logic & Business logic
if ur application is heavy on data logic than the business logic in the sense that it handles huge data. But at the same time, it doesn’t involve complex business logics & doesn’t represent a complicated transaction system, it is better to go for servlets itself.



Hi,

Thanks for replying me and I agree with your points.

But In the above you have mentioned that use of servlets if appln is heavy on data logic. Do you mean More Records in the table/More Transactions in the table for this 'DATA LOGIC'. Assume that if the Customer records are more,then will you go for Customer Entity Bean or Customer DAO object + servlets.

Regards,
M.S.Raman
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic