This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to find out what is the best way to call business logic components (eg. session beans) using the Struts framework.
I have read that the Action class can be used along with a Business Delegate pattern and Session facade to accomplish this. Is this the only way to do this, are there any other options? I am interested to know how exactly is it done in big enterprise level applications?
If there are any tutorial links or sample code I would be extremely grateful! Will really appreciate any thoughts.
Here is some code for calling remote stateful (SFSB)and stateless session EJBs (SFSB). In these examples, I just do it from a Servlet. There's lots of drawbacks to that, not to mention the tight coupling of the Servlet to the EJB. Your analogy would be tight coupling from the Struts action class to the EJB. Same difference.
The more layers, and more design patterns you use, typically decouples your control layer from your logic layer. That's typcially a good thing.
For some EJB development tutorials, including the multimedia tutorial that shows you how to create the EJBs used in the code below (I copied and pased the code from the tutorial), then check out the following link: