It strikes me that your example is a perfect use of Mike's mapping concept:

 
> Alias = action class + method name (default to execute())

.../CrudAction/create

I tended to go away from doing that some time ago. I am new to WebWork but
have been developing web applications for some time. 

At the end of the day someone or something is going to have to build a form
that has action="someurl"

I've had good success with just leaving 
action="" and putting my actions into my submit buttons

e.g. <submit name="WWAction_update" value="Update">
     <submit name="WWAction_create" value="Create">

The benefit of this is that once you are into a bean you don't have to screw
with urls at all. 

You already have to have a match between form-field/bean-property name so
this approach doesn't add much in the way of coupling.

Reacting on the url only means you need a different form for each action.

I'm definitely into having a framework that will pass parameters/select the
bean action to invoke/manage double-clicked submit buttons. I like what I've
been able to do with WW1.x so far. Is WW2 going to turn into another "death
by a million config files" like Struts?

-- Hoping for simplicity

Brett Knights


> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 02, 2003 6:04 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] WebWork2, here I come!
> 
> 
> On Wednesday, July 2, 2003, at 06:56  PM, Mike Cannon-Brookes wrote:
> > Well, there are tonnes of use cases for this (you are talking about 
> > commands
> > right?)
> >
> > The most commonly quoted one is a CRUD action. You create different 
> > methods
> > like doCreate(), doUpdate() and have the same fields (ie 
> name, email 
> > etc).
> 
> For CRUD actions, I'd probably (with what I know of WW2 thus far), do 
> this:
> 
> abstract public class CrudAction implements Action {
>     final public void setOperation(String operation) { ... }
>     final public String execute() throws Exception {
>        // switch on operation value
>     }
> 
>     abstract protected String create() throws Exception;
>     abstract protected String retrieve() throws Exception;
>     abstract protected String update() throws Exception;
>     abstract protected String delete() throws Exception;
> }
> 
> Why do we need an Action to have multiple entry points?  I 
> still don't 
> get it.  Having the framework lock it into a single entry point does 
> not prevent patterns of multiple entry point implementations.
> 
> I thought we were trying to get away from Struts... let's 
> lose the "do" 
> prefix :))
> 
>       Erik
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_06
> 1203_01/01
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to