Three layers , so the name of meaning, there are three levels. In turn, the display layer (VIEW/UI), the business logic layer, the BLL, and the data Access layer DAL. Not all programs have to use three-tier architecture, simple problems complicated is not a stupid behavior! If we do a small program, the business logic is simple, there is no real business storage layer, there is no need to use the three layer. But when your business is complex to a certain extent, you need to use a three-tier structure when your data is accessed to a separate database or storage medium.
display layer
The role of the UI is to show the user specific business data, the acquisition of user input information and operations, the user is supreme, taking into account the principle of the introduction of the line. The VB that we have learned, refers to the form and the form code. Here it is only responsible for displaying and capturing user actions, and does not contain any business-related logic processing.
business Logic Layer
The BLL is used to fetch data from the DAL for UI display, to get user directives and data from the UI, to execute business logic, and to write to the data source via the DAL. That is, the BLL handles business logic. By getting the operation instructions from the UI, the business logic is executed, and the DAL is processed directly when the data source needs to be accessed. After processing is complete, return the necessary data to the UI.
data Access layer
The DAL loads data (Select) from the data source, writes data to the data source (insert/update), and deletes data from the data source (delete). It only provides these basic data access and does not contain any business-related logical processing.
Dal/bll/ui are in different assemblies, respectively. The reference relationship between their layers is ui->bll->dal. The DAL is located in an assembly that does not reference the BLL and UI,BLL needs to refer to Dal,ui directly referencing the BLL and may indirectly refer to the DAL.
Learn about the problems encountered in the three floor
1, careless of the database written datebase
2, missing open DATABASE statement Conn. Open ()
Summary
Layer three can be the program of each business layer, the business can be independent, conducive to division of labor, improve efficiency. After learning three layers, only to know that they have done the student management system, computer room charge system how bad, but everything is slowly practiced out. In the subsequent reconstruction of the machine room to the three layer of knowledge to apply.
Three-layer structure