Matt Ho 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).
Ha! I've definitely spent too much time with Struts :)
It strikes me that if you want to combine the CRUD into a single class, you could do it as follows. It's not a short as a single class, but I think this is far easier to follow.
I don't see how this is easier to read than a doCreate() and doUpdate() method in an action?
For my part, I think that retaining execute() on the interface is the best thing to do. Beginners docs can say 'all you need to do is implement Action'. More advanced docs can say 'if you want more than one command - extend actionsupport, and use the doX() methods'.
The only time that you wouldn't use execute() is if you wanted more than one command. I don't want to read someone's webwork code, and try to work out where the entry point is.
Just because we can do something doesn't mean that we should.
From mike:
Execute() is a best practice, not a necessity?
I don't get the reason to remove it. Please give me an example of how removing this interface makes it easier.
So, -1 on removing execute() from the interface.
Scott
--
ATLASSIAN - http://www.atlassian.com Expert J2EE Software, Services and Support ------------------------------------------------------- Need a simple, powerful way to track and manage issues? Try JIRA - http://www.atlassian.com/software/jira
------------------------------------------------------- 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
