Query problem in the three-layer structure

xiaoxiao2021-03-06  26

Q: Our company is prepared to use COM technology to develop applications, how to achieve differences, mainly contradictory in the query section, divided into two dispatals: 1. A dispatch is just a simple data selection. It is proposed to save the basic SQL statement to a table in the database. The client is patchwork, and the business logic layer reads the basic SQL statement from the database to retrieve data. The entire system query calls the same query interface. 2. Another place that queries also belong to business logic, not simple SQL statement scatters, should be divided into different interfaces, and clients only pass some parameters to the business logic layer, and transfer the processing results. We have launched a fierce discussion and feel that the problem should be mainly concentrated in the following parts: 1. The query is just a simple data search or business logic? If it is a business logic, the service logic implementation of the first way is in the database end or the application server side. 2. If you use the first way to develop, is it good to develop the team? For example, mutual calls between each subsystem must disclose their own SQL statements, rather than providing separate interfaces. 3. What is the principle of using a view in a system? What is the impact of development and system upgrades if the number of views exceeds the data table? Because we are limited, whoever persuades no one, can only request aid, I don't know why herself?

1. Regardless of whether it is hard coding or serialization for the SQL statement, it is the protocol between the logical layer data accesses the interface and the data layer. 2. In the three modes of the relational database, the design of the SQL manipulation statement is the design of the application mode. 3. Use the three-story client server structure to make your app more easily extended and deployed. 4. Implementing serialization of SQL statements is a way to parameterize design, but requires full abstraction and design for data access interfaces. 5. After serialization, SQL code is stored in the business database, which increases the degree of coupling of the logical layer and the data layer, which is not conducive to the flexible deployment of the data layer. 6. Serialized data of SQL recommends using alone parameterized files or local database implementations. 7. For applications with high data access complexity, only dynamic SQL code is used, and the SQL statement that is designed to design a data access sub-layer can be achieved. Author: linchangping posted from: www.umlchina.com

转载请注明原文地址:https://www.9cbs.com/read-76788.html

New Post(0)