From: "Ted Husted" <[EMAIL PROTECTED]>
> With DispatchKeyAction, the key is used to call the method itself and
> does not need to be passed. Since reflection is being used, the key is
> implicit in the name of the method invoked.
No its not. What if I want to map several keys to a single method? That is
perfectly legitimate use-case where only one minor thing needs to change
between different key values.
So I would like to keep the key being passed to the reflected methods.
> In order to pass a parameter, it has to come from somewhere. Everything
> that perform "knows" is in the original signature, where any reflected
> method can get it.
Not the key though, not directly. The key should be passed to the reflected
method.
> Actions often need to pull properites and parameters out of the request
> and mappings. But this is best handled by other utility methods in the
> class, that each reflective method could call.
Agreed. But, again, not the key. DispatchKeyAction's smarts are in
determining the key. The reflected methods should not be required to look
it up again.
> I've annexed a DispatchAction with the initial refactoring I mentioned.
What do you mean by "annexed"? I don't see it anywhere in CVS?
> The idea is that you could start by extending this, overriding perform
> with your own method-name discovery routine, and then call
>
> return dispatchMethod(mapping,form,request,response,name);
But I want "key" also! :)
Plain ol' DispatchAction doesn't need to pass the key since it truly is the
method name being called, but not in the case of DispatchKeyAction where the
Map can point several keys to the same method which is a very handy feature.
> And some point between Struts 1.x and Struts 2.x, I'd like apply a great
> many instances of "extract method" throughout the framework, since many
> of our methods are a trifle long.
Yes, they are! And subclassing is difficult. Nothing a bit of refactoring
can't fix fairly easily though.
Erik
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>