Search code examples
.netdata-access-layerbusiness-logic-layer

What should we have in a Business Logic Layer (BLL)


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.


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