struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron O'Hara" <a...@globalreachsoftware.com>
Subject RE: validate business data
Date Fri, 14 Mar 2003 21:55:19 GMT
Dan,

In order to preserve a layered approach, there are 2 issues:

1) the display of errors
2) evaluating if an error has occurred

In my Struts applications, I have a Business Logic Layer (BLL) that will
always perform 2).  In the Action class, I call the validation function
to check for HTML form errors as well as calling the BLL to check of
business rule errors (such as the duplicate emails).  If an error is
found, my action class will put ensure the error appears on the page
which generated the error.  The displaying of errors usually occurs
through the application platform, so in this case, ensure that the error
message and error handling is done by Struts.

Using this approach, you can re-use your BLL for other applications
without having Struts tie-ins.

Aaron

-----Original Message-----
From: Dan Allen [mailto:dan@mojavelinux.com] 
Sent: Friday, March 14, 2003 1:48 PM
To: Struts-User List
Subject: validate business data

Naturally all screening of data should be done by the
ActionForm/Validator interface, but when it comes time to looking
for duplicate usernames/emails or other such business conflicts,
this must be done in the business logic layer.

How do most of you handle this?  Do you create a validateData()
method in your Action class or is this something that the Model
objects should be able to handle?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <dan@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Windows: where do you want your data to disappear to today?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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





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


Mime
View raw message