RE: Design question about ActionForm's validate method
The process we followed is very simular to what Ted suggested but depends on
how you are approaching the construction of your actions. If you have the
ability to write a collection of objects that handle storing and retreiving
data irreguardless of the data you might map it like this:

/do/store/address
/do/load/address
/do/load/user
etc ...

If however you want to segment it out as to what you are working on and then
the action you are performing on that thing you would merely reverse it to
this:

/do/address/load
/do/address/save
/do/address/delete

No what have we done in practice is a combination of those two. For one
project we were able to encapsulate the loading, sending, and saving type of
actions into one an action for each and thus the namespace we defined for
this was simular to the top .... this namespace was a bit easier to manage
but obviously the actions themselves were either larger or the beans they
used were larger, for us the actions. For another larger project we went for
breadth as we didn't have much that was reusable and therefor had many many
actions all acting on the data but in different unique ways. Therefor the
namespace we defined was more in line with suggestion two.

One standard we have imposed which I think works and looks much cleaner is
the /do/* instead of *.do. It requires less explaining to people on what is
a .do file ... hehhe ... and it has less legacy implications like.cgi and
.pl have ... a namespace is nothing more then a mapping to a resource,
therefor extension has less importance. Anyhow ... we use /do/* for all
actions.

Not sure if any of this has helped ... ;)

Sean


----- Original Message -----
From: Alex Paransky
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Sent: Wednesday, February 06, 2002 11:53 PM
Subject: RE: Design question about ActionForm's validate method


Ok, I understand how forcing all requests through the controller is a good
thing.  Now, I have various types of pages:
Forms - <html:form...
Actions - .do action of the form
View - basic .jsp page to view and link to a form for further edit
Is there a naming convention that you found works for you?  Since, I am
using .do extension for everything, it seems like I have URL's which look
like this:
AddressForm.do
AddressSaveAction.do
AddressView.do
I think it would be nice to have:
Address.form
AddressSave.action
Address.view
Or something like this.  The .do extension makes me think of "action" and I
don't see a form or a view as an action.  I could always map *.view and
*.form to execute the servlet as well, but then Address.form and
Address.view are ambiguous.
Any suggestion on naming conventions?
Thanks.
-AP_
http://www.alexparansky.com


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

Reply via email to