Question

I know this is a very basic question. But I am really not able to comprehend what should we have in BLL. Let me take an example.
Let us consider a Login.aspx web page, which is used to facilitate user login.
In this case Login.aspx will have two textboxes and one login button.(Presentation Layer).
Data Access Layer will have functions to check if username and password are correct.


I don't think I need something else in this page. So what will I have in BLL. If you want to add some functionality that should come in BLL, please add.

Was it helpful?

Solution

You should have something like this:

The UI calls BL.SaveUsernameAndPassword(string user, string pass);

BL.SaveUsernameAndPassword should validate the strings, and then call DAL.SaveUsernameAndPassword(string user, string pass);

DAL.SaveUsernameAndPassword should put these parameters into your SQL query and execute it, with the assumption that the data is valid

OTHER TIPS

No, the BLL checks if the username and password are correct. The DAL is only for data access.

"Data Acess Layer will have functions to check if username and password are correct" - wrong. The BLL will do that, the DAL will only retrieve (or try to retrieve) the user's information, without doing any checking on it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top