Forums Register Login

Its not necessary to use SLSB, or is it?

+Pie Number of slices to send: Send
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 ?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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 ?
+Pie Number of slices to send: Send
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.
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1006 times.
Similar Threads
where to turn next? need help with model layer talking to the database
Designing Distributed Transaction
Deleting from a DataBase
instance variable in session EJB
Stateful Session Bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 21:20:29.