This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Its not necessary to use SLSB, or is it?  RSS feed

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A read only object like a Catalog, may not require a Session Bean. Why can't I just call a DAO from the Servlet ?
Are there any advantages that using a SLSB would give over a Servlet for read only data ?
 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my personal opinion, It all depends on the architecture/context of the application.

Like if you application is not using EJB's at all, then just to read the data from database, i wont recommend using SLSB for this job. But if application already has EJB's and some different interactions are also required with some other systems, then we can use SLSB.
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

deepak adlakha wrote:In my personal opinion, It all depends on the architecture/context of the application.

Like if you application is not using EJB's at all, then just to read the data from database, i wont recommend using SLSB for this job. But if application already has EJB's and some different interactions are also required with some other systems, then we can use SLSB.



Even if I am using EJBs in other areas like persisting the data, how does it matter during a read operation that whether or not I use SLSB as far as my read operation is isolated from any external interface ?
Is there a reason I can't use Presentation + Servlet + DAO instead of Presentation + Servlet + SLSB + DAO ?
In fact, adding another layer can possibly slow down the application, no ?
 
deepak adlakha
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use Presentation + Servlet + DAO.

But I think as Servlet as one of the client for next Layer/Tier.

In Presentation + Servlet + SLSB + DAO. Advantage which i see is if tomorrow if you have one more client(say some other EJB component or web service) besides servlet for SLSB, then your DAO is not directly exposed to the client.

But in case of Presentation + Servlet + DAO. if new client is added then you may need to expose your DAO directly.
 
pie. tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!