I think a good example of the manager classes are in the sample
Struts-based application generated by AppFuse:
https://appfuse.dev.java.net/.
I have yet to see the full benefits of these manager classes, however I
am currently attributing this to my general newbieness with Java web
applications.
Glen
[EMAIL PROTECTED] escribió:
Rivka, I'll add to this:
Pick up "Core J2EE Patterns" from Sun. It is worth the money and will help you.
My solution would be similar to what Ed said. I would use a "manager" class (aka "business facade",
"business delegate", "service manager", etc. although each one of these may mean something slightly
different) to decouple Struts from your EJB layer. Struts actions talk to the manager only. The manager methods
(typically logon + C.R.U.D. + search -- general user actions) throw SystemException and ApplicationException only.
Struts is configured to handle these (or subclasses of these) declaratively (or else try/catch for these two in your
Action class if you haven't gone declarative yet). Struts then knows nothing about RemoteException and other specific
Exceptions like that. It only has to worry about two Exception types (but can go finer grained by handling subclasses
of these when you are ready). Meanwhile your manager class (or some data access object/manager behind the main manager)
handles try/catch for RemoteException, EJB Exception, etc. If manager cannot do his job
, he either throws SystemException or ApplicationException at the "user"
(Struts).
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]