i’m using three tier architecture with c# and sql server database as the data source. according to DRY principal the validation should be done in one place only which in my case is either the front end data access layer or the database stored procedures.
so i was wondering whether to validate the stored procedure parameters in data access layer or leave it to stored procedure itself??
DRYis an important principle, but so is defence in depth.When it comes to validating input, you must ensure it is safe – this should be done on each and every level (so both in DAL and stored procedure).
As for validating data for business logic, this should be in your business logic layer (BLL).