Introduction to the DTO layer of the framework

 I didn't go anywhere during the New Year, so I stayed at home and wrote a few blogs to share with you. I am usually very busy at work, and it is rare to have time to write something. On New Year's Eve and the first day of the new year, I posted a previous article, and there are so many bloggers accompanying me, like me, ha ha.

The above roughly introduces the ORM layer and the business layer. ORM is mainly for data access, freeing programs from routine stored procedure calls and error-prone Sql statements; the business layer is mainly to standardize the organization of business logic, simplify transaction processing, and use energy to process business logic on the cutting edge. For very small BS software, having these two layers is already usable, but if you want to consider integration and client, you will feel that only these are not enough, the flexibility of data processing is not enough, the client interface Demonstrates too tight coupling with the business logic layer.

The following will introduce the data exchange layer, service layer, and DTO layer. Let me introduce it from the DTO layer first. For the DTO layer, some friends may feel that there is no need for it. There is an extra layer, or it may be the case. Complexity, workload, higher requirements on people, higher cost, etc., are all aspects to be considered.

The DTO layer, that is, communicates with the client on the server side, transmits the data of the business logic layer to the client, and then transmits the data of the client to the server. There is a data exchange, and the data exchange will be introduced later. The data of the DTO must be able to support the data binding of the client. Some friends may ask, is it not possible to use the data of the business layer? The answer is: If it is within the local area network, it is not possible on the wide area network. There is a lot of data in the business layer that is loaded late. When transmitting data on the network, it is usually required to transmit a large amount of data at a time, which is the usual coarse-grained design. The overhead of establishing a connection is too large, and the delay is too large. . In addition, customers

Guess you like

Origin blog.csdn.net/zhaomengsen/article/details/83439430
dto
Recommended