Comments inline - don't usually do that
----- Original Message ----- 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Developers List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 1:54 AM
Subject: Re: DispatchAction


> Niall Pemberton wrote:
>
> >You're making the assumption that everyone wants to do things the way you
> >do - SimpleDispatchAction doesn't replace any of them if people don't.
> >Personally (if I used them :-)) MappingDispatchAction looks good to me
for
> >most use cases or if I didn't want to specify anything in the
> >struts-config.xml then have a custom DispatchAction that just always used
> >"method" as the parameter name to find the method name from the request.
> >
> >Niall
> >
>
> I guess I am not communicating well at all.
>
> I have no idea what people want to do and not only am I aware that
> people are not very predictable but also that I have no desire to try to
> get people to do anything whatsoever.   I can tell you that also having
> been a Federal Public Defender I am really, really aware of the variety
> of choices people will make.  ;-)
>
> I just am saying that for my money a class that does exactly the same
> thing as three other classes and is faster, lighter, and less coupled is
> preferrable to me.  I also suspect it will be preferrable to others, if
> that is right.  So, I assumed the only issue was whether it was better,
> and not whether people liked things that were not better.

* It doesn't do EXACTLY the same as MappingDispatchAction or DispatchAction
(I'm ignoring LookupDispatchAction 'coz I don't like it). It almost does the
same as MappingDispatchAction except that MappingDispatchAction requires the
method name in the struts-config.xml and throws an Exception if it isn't
there. DispatchAction also throws an Exception if theres no parameter in
struts-config.xml and uses the parameter to find the name from the Request.
Can't see how you can say SimpleDispactgAction does exactly the same thing -
it doesn't.

* I don't see how its "faster or lighter" - most of its code is just a
duplication of whats in DispatchAction and the only difference is the
determination of the method name.

* If I used dispatch actions I would create my own custom one that always
used "method" as the parameter name to get the method name from the Request.
I'm sure that would suit most situations, would mean nothing was required in
struts-config..xml and the custom action wouldn't have to go through all the
request parameters find one that ended in ".x"


> I would give people the dignity of arguing with them a bit about it, if
> they disagree, in order to see what they are thinking.  I am not sure,
> Niall, that you see what is happening in this case, given you previous
> posts, but let me say that the logic in SimpleDispatchClass replaces the
> logic in all these other cases and gives you more flexibility.  If you
> prefer to have to code the struts-config.xml when you don't have to and
> if you prefer to have heavier code in an underlying super class, and if
> you prefer to have a situation where you cannot use a single solution to
> all uses of buttons, then you won't want to use SmpleDispatchAction.
> But, if you do like your code to be simple, lightweight, generic, and
> fairly straightforward, you might try SmpleDispatchAction.

Well given that I don't use them its probably a bit rich stating my
"preferences" :-) but anyway. MappingDispatchAction looks OK to me - if I
hated specifying stuff in the struts-config.xml then I wouldn't be using
Struts. Also seems to me that having different "paths" for each of the
actions would be a good thing - my app controls user access based on the
path - so having /save.do and /delete.do with different parameters seems
like a better idea than just having one action mapping. Anyway I was never
argueing for this - but its different and I thinks its a valid option for
people to have.

> Do you see that you can do exactly the same thing with
> SimpleDispatchAction as with MappingDispatchAction and without the heavy
> load of DispatchAction?  Do you see also that you can do exactly the
> same thing with SimpleDispatchAction as all three of these classes?
> Heck, if you see all this and prefer to use those classes, I would be
> surprised but would not be plussed.  (Is there a "plussed" to go with
> "nonplussed"?)

I don't get the "heavy load" bit at all, not if you're taling about the
actual code in the classes rather than how you configure the xml and view to
use them.

> The preceding sardonic presentation is meant to be a bit comical, but I
> would be interested, Niall, in knowing why you would do what you say you
> would, given what seems to be a pretty decided inferiority of the
> classes you say you would use.  I may well be completely wrong in my
> assessment and would welcome any critique you have to offer.  Maybe I
> too should do what you suggest, but I cannot see it.

Actually never said I would use them - I don't, I use plain old Action
classes and am happy doing so.

> Laughin' and Lovin' inWashington,
>
> Michael McGrady



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

Reply via email to