Three-tier architecture diagram:
three layers introduced :
UI layer: The presentation layer is responsible for displaying the contents of a page or form
The BLL layer: The business logic Layer handles business logic, but it acts as an isolation
The DAL layer: The data access layer deals with data and gets or modifies data from the data
Model Layer: Solid layer
How to actually use the three-tier architecture to complete programming in re-programming:
Analytical:
1, build three-storey architecture, everyone's habits are different, recommend everyone from the bottom of the model layer, the next is the DAL layer, if we need to change the namespace, then change the system automatically generated Class.cs delete, right click on the DAL layer to complete the generation
2, Next, after creating the Ui,ui, add a reference to the DAL layer, if everyone vs with 2012, then the point solution then tick the corresponding DAL layer name, and then OK
3, by using the keyword, the introduction of the Namespace!
4. Regenerate the UI layer
Sqlelper Class Introduction
Why introduce the SqlHelper class?
Analytical:
Because we want to improve work efficiency, in a short period of time to quickly put data into the database, only need to provide users with a SQL statement to
APP. Config file is introduced
APP. Config is a configuration file that must be added at the UI level, but we know that Sqlhelp was created at the DAL layer. In the Sqlhelp class, with ConfigurationManager to parse app. config, it is necessary to forget the introduction of namespaces, under the. NET assembly, there is a System.Configuration namespace
Multi-path anomaly capture
Three reasons for abnormal appearance:
1. Code error: Including logic error
2. Resource unavailable: Error caused by unauthorized access to the system
3. Common language Runtime: there is an internal error caused by the CLR
Two. NET exception handling mechanism
1, one is the exception that is thrown by the client program execution, derives from the ApplicationException class.
2. The other is an exception thrown by the public voice runtime, derived from the SystemException class.
Layered development of a---software system