Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by GabrielZimmerman:
http://wiki.apache.org/struts/RoughSpots

------------------------------------------------------------------------------
      * [tm_jee] +1 What do you think about the reference docs, we put a lot of 
effort in it. Of course there's still lots of room for improvement. We'll 
continue to do our best. :-)
  
    1. Do we want to keep `ModelDriven`?
+     * [Gabe] Absolutely YES! `ModelDriven` allows us to build forms and 
populate the model without a prefix. It's simple. It also allows for security 
interceptors to zero in on one method for `ModelDriven` actions to determine 
what to secure. 
  
    1. Do we want `ValidationAware` (or its equivalent) to take message keys or 
actual messages. It takes the actual messages in WW2. `ActionMessages` in 
Struts takes keys. I'm a fan of keys; we would no longer need `TextProvider`. 
Pat suggested we take keys, and in the event that we don't find a message for 
the given key, pass the key along as the message. I think I'd rather fail fast.
      * [mrdon] Keys are fine, as long as you can do parameter replacement 
easily enough later.  Not all apps need L18N, so I'm kinda against the fail 
fast.  Perhaps in devMode, we add a clear warning?
@@ -291, +292 @@

    1. Specify and simplify Interceptor scope. Currently, you have an 
Interceptor that calls actionInvocation.invoke() and then returns a different 
result than actionInvocation.invoke() returns, the actionInvocation.invoke() 
result will be used anyway. This is confusing and muddies the meaning of the 
Interceptor API, which IMHO should simply wrap the action not the action all 
the way through to the end of the result. The reason it's set up the way it is, 
as I understand it, is so that Interceptors can clean up resources like 
connections after the result is returned. However, I wonder if we can implement 
a request based object that can take care of such resources and destroy them at 
the end of the request rather than using Interceptors in this way.
       * [crazybob] That was really surprising and confusing to me at first, 
too. I thought it would have been more intuitive for the result to run after 
all the interceptors returned. I'm not sure whether we should change it or not. 
I like the idea of interceptors being able to clean up after results a lot more 
than I like the idea of an interceptor being able to return a different result.
       * [Gabe] It is an advantage for Interceptors to be able to clean up at 
the end of a request, but it isn't great how they do that either. Take for 
example an action chain. If you have a create connection Interceptor 
surrounding each of the chained actions, you will open two connections, which 
besides being wasteful could cause problems with other resource types. I wonder 
if we can create some sort of request scoped ResourceManager class that can 
allow Interceptors to create resources or access them if they exist and specify 
how they should be destroyed at the end of the request. Thus in the connection 
case, the Interceptor could check if the resource manager had one and if not 
create it and add it to the resource manager for other objects to use. (Another 
option of course is an inversion of control approach)
-     * [jcarreira] Interceptors can still change the result... Implement 
PreResultListener and in your callback, change the resultCode and voila! The 
result executed will be changed. The PreResultListener interface lets you 
register your interceptor to get a callback after the action and before the 
result is executed. Oh, and on the ConnectionInterceptor -> It's just like AOP. 
You have to check if it's been done already and know not to create a new one or 
close it on the way out. I do this all the time in AOP interceptors, so why 
should this be different? Personally, I'd rather use the same connection across 
all of the actions in a chain than clean it up after each one and use a new one 
per action. For request scoped resources, take a look at Spring's scoped 
components. I'm using them at work and they work pretty well (a few issues I'm 
working through with them notwithstanding). 
+     * [jcarreira] Interceptors can still change the result... Implement 
PreResultListener and in your callback, change the resultCode and voila! The 
result executed will be changed. The PreResultListener interface lets you 
register your interceptor to get a callback after the action and before the 
result is executed. Oh, and on the ConnectionInterceptor -> It's just like AOP. 
You have to check if it's been done already and know not to create a new one or 
close it on the way out. I do this all the time in AOP interceptors, so why 
should this be different? Personally, I'd rather use the same connection across 
all of the actions in a chain than clean it up after each one and use a new one 
per action. For request scoped resources, take a look at Spring's scoped 
components. I'm using them at work and they work pretty well (a few issues I'm 
working through with them notwithstanding).
+     * [Gabe] The question is not about functionality but about simplicity of 
implementation. Can we, for example, allow the return from the intercept method 
to change what is executed regardless of whether it is returned before or after 
`actionInvocation.invoke()` and get rid of `PreResultListener`? IMHO that would 
positively simplify things. I'm not too particular about whether `destroy()` is 
called before or after the result is executed to clean up resources.
  
  == Tim's Issues ==
  I'm new around here, so be nice ;)  I probably have a lot less WW experience 
than most, so I apologize in advance if I'm flat out wrong about some of the 
things here.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to