You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Paul Benedict <pb...@apache.org> on 2007/03/07 07:37:02 UTC

[s1] ActionContext in execute()?

Just gathering some opinions here...

Would it be preferable to accept an ActionContext in execute() rather 
than the 4 parameters?

public ActionForward execute(ActionContext context) throws Exception;

Thanks,
Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Paul Benedict <pb...@apache.org>.
Since there already has been a lengthy discussion, is anyone interested 
in deciding something?

Martin Cooper wrote:
> On 3/7/07, Joe Germuska <jo...@germuska.com> wrote:
>>
>> We talked about this at some length when the ActionContext was first
>> introduced.
> 
> 
> IIRC, "at some length" would be a bit of an understatement. ;-) I'm sure
> there are numerous lengthy threads on this subject in the list archives.
> 
> -- 
> Martin Cooper
> 
> 
>  We also talked about having the base action implement
>> ActionCommand and/or some other options.
>>
>> I think the only reason we didn't do it then was because it was still 
>> new,
>> and we thought we'd let it settle in for a while.  In fact, the idea you
>> suggest may at one point have been on the roadmap for 1.4.
>>
>> Joe
>>
>> On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
>> >
>> > Just gathering some opinions here...
>> >
>> > Would it be preferable to accept an ActionContext in execute() rather
>> > than the 4 parameters?
>> >
>> > public ActionForward execute(ActionContext context) throws Exception;
>> >
>> > Thanks,
>> > Paul
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: dev-help@struts.apache.org
>> >
>> >
>>
>>
>> -- 
>> Joe Germuska
>> Joe@Germuska.com * http://blog.germuska.com
>>
>> "The truth is that we learned from João forever to be out of tune."
>> -- Caetano Veloso
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Martin Cooper <ma...@apache.org>.
On 3/7/07, Joe Germuska <jo...@germuska.com> wrote:
>
> We talked about this at some length when the ActionContext was first
> introduced.


IIRC, "at some length" would be a bit of an understatement. ;-) I'm sure
there are numerous lengthy threads on this subject in the list archives.

--
Martin Cooper


  We also talked about having the base action implement
> ActionCommand and/or some other options.
>
> I think the only reason we didn't do it then was because it was still new,
> and we thought we'd let it settle in for a while.  In fact, the idea you
> suggest may at one point have been on the roadmap for 1.4.
>
> Joe
>
> On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
> >
> > Just gathering some opinions here...
> >
> > Would it be preferable to accept an ActionContext in execute() rather
> > than the 4 parameters?
> >
> > public ActionForward execute(ActionContext context) throws Exception;
> >
> > Thanks,
> > Paul
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
>
> --
> Joe Germuska
> Joe@Germuska.com * http://blog.germuska.com
>
> "The truth is that we learned from João forever to be out of tune."
> -- Caetano Veloso
>

Re: [s1] ActionContext in execute()?

Posted by Paul Benedict <pb...@apache.org>.
Niall Pemberton wrote:
> Better IMO to move from Action's to Commands rather than putting the
> Command into the Action - also Commons Chain has a DispatchCommand:
>
> http://tinyurl.com/38j7vk
>
> Niall
>
Thanks Niall. After going out to dinner, I decided against my own idea. 
This would be a 3rd form of dispatching in the Struts universe. I would 
prefer actually to make it look identical to the Struts 2 signature:

public void execute() throws Exception

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Niall Pemberton <ni...@gmail.com>.
On 3/19/07, Paul Benedict <pb...@apache.org> wrote:
> I tried this out tonight, and I thought it was very beneficial to
> cleaning up my code. In particular, not having to declare parameters
> that I do not need to use.
>
> public void execute(ActionContext context) throws Exception {
> }
>
> Steps for development:
> 1) Add this method signature to Action
> 2) Would then dispatch to a like signature but of ServletActionContext
> 3) #2 method would, by default, dispatch to the typical parameter version.
>
> This also allows some interesting dispatching. I can also write a
> dispatcher that dispatches according to this method signature. I really
> like it the idea.

Better IMO to move from Action's to Commands rather than putting the
Command into the Action - also Commons Chain has a DispatchCommand:

http://tinyurl.com/38j7vk

Niall


> +1. Anyone against it?
>
> Paul
>
> Ted Husted wrote:
> > Yes, doing this was on the old 1.4 roadmap.
> >
> > On 3/7/07, Joe Germuska <jo...@germuska.com> wrote:
> >> We talked about this at some length when the ActionContext was first
> >> introduced.  We also talked about having the base action implement
> >> ActionCommand and/or some other options.
> >>
> >> I think the only reason we didn't do it then was because it was still
> >> new,
> >> and we thought we'd let it settle in for a while.  In fact, the idea you
> >> suggest may at one point have been on the roadmap for 1.4.
> >>
> >> Joe
> >>
> >> On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
> >> >
> >> > Just gathering some opinions here...
> >> >
> >> > Would it be preferable to accept an ActionContext in execute() rather
> >> > than the 4 parameters?
> >> >
> >> > public ActionForward execute(ActionContext context) throws Exception;
> >> >
> >> > Thanks,
> >> > Paul
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Paul Benedict <pb...@apache.org>.
I tried this out tonight, and I thought it was very beneficial to 
cleaning up my code. In particular, not having to declare parameters 
that I do not need to use.

public void execute(ActionContext context) throws Exception {
}

Steps for development:
1) Add this method signature to Action
2) Would then dispatch to a like signature but of ServletActionContext
3) #2 method would, by default, dispatch to the typical parameter version.

This also allows some interesting dispatching. I can also write a 
dispatcher that dispatches according to this method signature. I really 
like it the idea.

+1. Anyone against it?

Paul

Ted Husted wrote:
> Yes, doing this was on the old 1.4 roadmap.
> 
> On 3/7/07, Joe Germuska <jo...@germuska.com> wrote:
>> We talked about this at some length when the ActionContext was first
>> introduced.  We also talked about having the base action implement
>> ActionCommand and/or some other options.
>>
>> I think the only reason we didn't do it then was because it was still 
>> new,
>> and we thought we'd let it settle in for a while.  In fact, the idea you
>> suggest may at one point have been on the roadmap for 1.4.
>>
>> Joe
>>
>> On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
>> >
>> > Just gathering some opinions here...
>> >
>> > Would it be preferable to accept an ActionContext in execute() rather
>> > than the 4 parameters?
>> >
>> > public ActionForward execute(ActionContext context) throws Exception;
>> >
>> > Thanks,
>> > Paul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Ted Husted <hu...@apache.org>.
Yes, doing this was on the old 1.4 roadmap.

On 3/7/07, Joe Germuska <jo...@germuska.com> wrote:
> We talked about this at some length when the ActionContext was first
> introduced.  We also talked about having the base action implement
> ActionCommand and/or some other options.
>
> I think the only reason we didn't do it then was because it was still new,
> and we thought we'd let it settle in for a while.  In fact, the idea you
> suggest may at one point have been on the roadmap for 1.4.
>
> Joe
>
> On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
> >
> > Just gathering some opinions here...
> >
> > Would it be preferable to accept an ActionContext in execute() rather
> > than the 4 parameters?
> >
> > public ActionForward execute(ActionContext context) throws Exception;
> >
> > Thanks,
> > Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s1] ActionContext in execute()?

Posted by Joe Germuska <jo...@germuska.com>.
We talked about this at some length when the ActionContext was first
introduced.  We also talked about having the base action implement
ActionCommand and/or some other options.

I think the only reason we didn't do it then was because it was still new,
and we thought we'd let it settle in for a while.  In fact, the idea you
suggest may at one point have been on the roadmap for 1.4.

Joe

On 3/7/07, Paul Benedict <pb...@apache.org> wrote:
>
> Just gathering some opinions here...
>
> Would it be preferable to accept an ActionContext in execute() rather
> than the 4 parameters?
>
> public ActionForward execute(ActionContext context) throws Exception;
>
> Thanks,
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com

"The truth is that we learned from João forever to be out of tune."
-- Caetano Veloso