What ideas do people have about where is the best
place to perform validation of items that come back
from ActionForms?
Example: check to see if the user's choice of
motherboard, memory, and cpu are compatible with each
other.
Following the struts example, it seems like the
validate() method in an ActionForm is used only for
light validation (i.e. checking to see if something
was left blank, or checking for alpha and numeric
chars). This approach seems correct to me, since there
should not be business logic inside the ActionForm.
That leaves most of the work to the business domain
object since any nontrivial application will not have
business logic in the Action class either.
The business domain object, in many cases, will be
accessed remotely from the Action class.
Does it make sense for the business domain object to
return an ActionErrors object(it is serializable)? I
am not 100% comfortable yet with the idea of importing
ActionErrors into the business object since it couples
it to struts to a certain extent, and it could
potentially be large.
Is the only alternative to send back a list of generic
error codes from the business object that each map to
an ActionError and the Action class could add the
ActionErrors? (i think i'd rather import actionerrors
in this case)
What are some of the "best practices" people have
found to work for this problem?
Craig and ALL Struts creators: Struts is really
great. Thank you for all of your hard work. It is
definitely something to be proud of.
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/