File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Its not necessary to use SLSB, or is it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Its not necessary to use SLSB, or is it?" Watch "Its not necessary to use SLSB, or is it?" New topic
Author

Its not necessary to use SLSB, or is it?

aditee sharma
Ranch Hand

Joined: Jul 22, 2008
Posts: 182
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 ?
deepak adlakha
Ranch Hand

Joined: Jul 27, 2001
Posts: 325
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

Joined: Jul 22, 2008
Posts: 182
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

Joined: Jul 27, 2001
Posts: 325
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Its not necessary to use SLSB, or is it?