I have a few quick questions about the use of the business logic layer in the average N-Tier architecture application.
I am developing my final year university project, and using a web forms presentation layer, business logic layer, data access layer and data layer.
1) What are your opinions on where is the best place to perform user input validation? To me it makes sense to use the presentation layer with something like jQuery validation for client side, and ASP.NET validation controls for server-side validation - however plenty of articles state it is best to perform validation in the BLL?
2) Currently my BLL is fairly thin, 90% of the classes simply act as an interface to the DAL, however I do know there will be more there eventually. In my DAL I have multiple select commands for each entity, e.g. GetAllProducts(), GetProductsByCategoryID(categoryID), GetProductByProductID(productID), GetProductsBySupplierID(supplierID). This appears to have a low level of business logic involved, i.e. technically there should simply be a GetAllProducts() function, which could be filtered using code in the BLL.
What is your opinion on the best practices for this? One select statement with filtering in the BLL, or as many select statements as needed to get the data I want? I would imagine always selecting every product would get pretty heavy on resources on large scale apps, however at least there is a true separation of logic between tiers.
Cheers, Stu.