Data persistence layer (01)

zhaozj2021-02-12  143

Database persistence layer reading "Robust Database Persistent Layer"

Three persistence methods:

First, hard code SQL in the business class

Features: SQL code appears in your class code everywhere. Any small change teaching leads to the modification of the code level. Benefits: Code efficiency is highly disadvantage: Directly coupled to your business class and relational database structure (Data Schema) applicable: small applications or prototypes.

Second, hardly encode SQL code in stored procedures or separate data classes.

Features: Writing a stored procedure or use ADO benefits: partially closed the processing interaction into a separate data class. Disadvantages: Database changes still modify and recompile (data classes) Applicable: Protocol or less than 40,50 business classs.

Third, the persistence of robust

Features: Mapping objects to a certain persistent mechanism (Robust's persistence layer) Benefits: Application developers do not need to understand the structure of the relational database, the simple change of the database structure does not affect the code. Disadvantages: The impact on the performance of the application is inevitable. Applicable: Large-scale applications for critical business.

(to be continued)

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

New Post(0)