I. Overview.
The three-tier architecture typically has a three-tier architecture that divides the entire business application into: Presentation layer (UI), Business Logic Layer (BLL), data access Layer (DAL). The purpose of distinguishing hierarchy is to think of "high cohesion, low coupling". Second, understand the various layers
UI layer: This is the primary purpose of the presentation layer to interact with the user. For example, the computer room charge system in the recharge this form, to enter the card number, the UI layer is the purpose of the input card number information to the BLL layer. The goal is to pass data to the BLL layer, and the UI layer does nothing to determine any action.
BLL layer: Business logic layer, this is the data from the UI layer, to judge, simply to do a series of logic on the operation. or the recharge form to example, card number passed to the BLL is not the card number in the DAL layer to make judgments, but using the BLL layer to call the DAL layer to the database of the card number information to the BLL layer. On the BLL layer, the card information from the UI layer and the card number information of the DAL layer are gathered, which is a comparison of the two information. If the card number exists then the BLL layer invokes the DAL layer on the database operation. The DAL then passes the results of the database operation to the BLL layer. The BLL layer on the temporary deposit of the recharge card number information. This information is called directly from the BLL layer when the UI layer needs this data. Show up.
Another example: The combination of queries, the BLL layer has the SQL statements in the combination of parameter statements and then directly to the DAL layer.
DAL layer: Data access layer. is a layer of operation with the database, if the database is SQL sever then this layer has a lot of purpose SQL statements. is the direct operation of the database.