Layering is a very important idea in software design, especially for large software systems. Divide and conquer is a commonly used method in computers. For example, the TCP/IP layer-7 protocol stack is a typical hierarchical application. Any qualified software developer must master the hierarchical thinking. Below are several basic concepts of software layering:
I. layering
1. The classic three-tier theory divides applications into three layers
(1) Presentation Layer: displays information and processes user requests.
(2) domain logic layer: logic, actual business activities, and true core of the system
(3) data access layer: communication with databases, message systems, etc.
In actual application, there are four layers of five layers (such as J2EE. In Windows. net, the presentation layer allows common data-aware components to access the database, making it easy to use. However, this technology destroys the dependency between the layer and the layer. It is generally not allowed for the development of large software, and it cannot be used by small software.
2. Basic principles: the domain layer and Data Source layer must not depend on the presentation layer.
Ii. Presentation Layer
User Interface, web page or Windows form.
3. Domain Layer
The organization of domain logic has three modes:
(1) Transaction Script: Structured
(2) domain model: Object-oriented
(3) Table module: related to the record set .. Net contains a record set-based tool (datatable/dataset), which makes it easier to use the table module.
Iv. Data access layer
There are two basic methods to create an entry for a database table:
(1) Row data entry: one instance for each row in an object-oriented manner.
(2) table data entry: record set, such as datatable and dataset in. net
For the design of the data access layer under. net, refer to my other article.Article: A simple design and implementation of the database access layer