[Logo]
Forums Register Login
Its not necessary to use SLSB, or is it?
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 ?
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.
 

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 ?
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.

This thread has been viewed 870 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 22, 2018 04:56:43.