On Fri, Oct 24, 2003 at 01:47:41PM +0100, John Patterson wrote:
> I notice that in previous discussions on this list, people talk a lot
> about using ServletFilters to open a Session and ensure it is closed.
> Is there any problem with using an interceptor to do this?

[wrapped your text]

This will work generally. I, personally, consider this a violation of
the command pattern if you consider hibernate belonging only to the
model layer and not to the view layer. You might argue this is a
distinction without difference but is will lend to trouble if the view
layer invokes any operation in the model (action) which throws an
exception.
I prefer to have the action build a finished model and the view can
assume that no error will occure if any of the models getters will be
called.
This leads me to a problem in the current interceptor design of xwork:
the invokation of the result is part of the invokation chain and
therefor braced by the interceptors. The is currently no way to
intercept only the actions invokation and exclude the result from this.
The are of cause workarounds like using a special ActionFactory which
uses the AOP framework of your choice to introduce interceptors only
around your actions. But IMHO this sucks a little.

-billy.

-- 
Meisterbohne   Meisterbohne GbR, Küfner, Mekle, Meier   Tel: +49-731-399 499-0
   eLösungen   Söflinger Straße 100                     Fax: +49-731-399 499-9
               89077 Ulm                           http://www.meisterbohne.de/


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to