Link to home
Start Free TrialLog in
Avatar of dotsandcoms
dotsandcoms

asked on

validations in 3 tier application

Hello experts,

M developing the 3 tier application. I have one entry form and i want to put the validations for this entry form. Where do i put it? In BAL (Business access layer) or UI or somewhere else?

Please guide me.

Many thanks
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Quoting steve from http://forums.asp.net/t/1597280.aspx/1

Validation at the presentation layer makes for a better user experience.

Validation at the 'lower' levels is important because the presentation layer may not be what is modifying the data.  Maybe it's a bulk import program or maybe it's SQL Studio that is modifying the data.

The most important validation is at the database level.  Because if invalid data gets in the system, all hope is lost.   And maybe someone's job!

Read these discussions too:-
http://msforums.ph/forums/p/54654/269489.aspx
http://asp.net.bigresource.com/Architecture-Data-Validation-in-a-3-tier-application--s9sQx80X2.html
They should really be in both shouldn't they?

Totally agree about the user experience.  In my own 3-tier app I validate in the form to ensure that dates/blank fields etc are all recognised immediately.  Then I have further validation in the BAL to ensure that database logic is being followed.  Some of this happens in stored procedures, others in the BAL layer itself.
Avatar of dotsandcoms
dotsandcoms

ASKER

excellent solution