Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

dummy questions about EJB (session bean)  RSS feed

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36417
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!