Data persistence layer (03)

zhaozj2021-02-16  71

Sustainable needs

In the text, 28 requirements were proposed, almost all of the database operations were included, and the themes were as follows:

Multiple persistent mechanisms. (Text file, relational database, object-relational database, hierarchical database, network database, object database, etc.), this article mainly discusses relational databases. A complete package for a persistent mechanism. You don't have to write any other code about the persistence layer, you need to send Save, Delete, Retrieve message to an object. Condition-based multi-object operation. Supports a case where multiple objects are returned (delete) according to certain conditions. The associated multi-object operation. Support transaction. Scalability. You can add new classes or properties and can easily change the persistent mechanism. Object identifier. Support primary key combination keys Multi-key game evaluation result set size first determine how long-lasting objects will be affected by this operation. Agent supports an identity represents an object to reduce overhead. Record support returns record instead of objects. A variety of architectures. Different database versions and manufacturers multi-connection connecting pool dedicated and non-dedicated drivers. Such as: ODBC, JDBC, third-party dedicated drive and other languages. Map flexibility. There are three main ways to support mapping class hierarchies. Generate a database structure. . Similar to the CASE tool relationship traversal. SQL query. Although the SQL query is written in the object-oriented code is the open back of the package (this will directly couple the application and database structure), but the persistence layer still has to support this! (Why? Performance!) Call the stored procedure. Although it is necessary to avoid the use of a stored procedure that is difficult to transplant, it is occasionally used. Buffer. lock. You can specify a pessimistic lock or optimistic lock support management tool. Running on metadata that can be maintained. Running configuration. Such as: the size of the cursor, the name / location of the lasting mechanism.

Summary: The persistence layer should make the program developers don't have to care about how their objects are stored. On the other hand: the DBA is also allowed to freely modify the database structure without having to introduce the BUG.

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

New Post(0)