开发者

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 i开发者_StackOverflow社区n 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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜