我是 3 层架构的新手,因为它由 UI、BAL 和 DAL 层组成。所以我在 DAL 中编写所有数据库代码,我已经在 BAL 中声明了变量,我已经在 UI 中调用了这些方法,但这是是正确的编码方式??我的 BAL 在做什么?业务层的主要目的是什么?谁能解释我,谢谢。
//In my BAL
public class ProfileMasterBLL
{
public int UserId { get; set; }
public string FormFiledBy { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
//在我的用户界面中
ProfileMasterBLL pmBLL = new ProfileMasterBLL();
pmBLL.FirstName = TextBox1.Text;
pmBLL.LastName = TextBox2.Text;
//In my DAL
insert() 方法
那么我该如何调用 ProfileMasterBLL.insert() 呢?正如我在 DAL 中所写的那样。