Forums Register Login

dummy questions about EJB (session bean)

+Pie Number of slices to send: Send
I have very little knowledge about EJB. Here is my question --

1. If I have a struts action class, the action calls a stateless session bean, stateless session bean calls a DAO class. If I bundle all things together in a EAR, then what's the point of using that stateless session bean ? can I simply replace that session bean by a java class ?

2. Now, I believe the benefit of EJB is it provides distributed computing. Let's refer to the above scenario. assume I have the following things --

JSp, action, stateless session bean, DAO.

a) when I create .war, which pieces shall I bundle together, shall I bundle JSP, action, DAO ?
b) for EJB .jar, shall I just bundle the bean(s) ?
c) getting to the distributed point, is it true that I can deploy the .war and .jar to different machine ? But it seems people just bundle the whole thing in a .EAR, then does it mean we are NOT using the distributed feature of EJB ?

Thanks.
+Pie Number of slices to send: Send
1) The benefit of the session bean is to provide a hook for container managed services such as transactions and security.


2a) JSP and action go in the war. The DAO should go in the ejb project since the EJB calls it.
2b) see answer to a - you don't want your ejb to depend on the web project
2c) yes. ejbs provide benefits even if you aren't using remote interfaces
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 880 times.
Similar Threads
transaction in EJB 2
Tomcat and openEJB - how to do this simple config?
Architecture- Struts bigger scene.
Different ways of dependency injection
inner class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:01:27.