Data persistence layer (04)

zhaozj2021-02-16  66

Summary design of persistent layers

First of all: Build a lasting layer is very difficult, don't try one person! Table: Classs and descriptions in high-level design (Note: Among them, only PersistentObject, Persistentcriteria, and Some classes, PersistentTransAction and Cursor classes are directly accessed by the application.)

Class Description ClassMap A set of classes, encapsulates the behavior of mapping the class to the relational database. CURSOR This class encapsulates the concept of the cursor in the database. PersistenceBroker maintains a connection such as a database or text file, and handles communication between the object application and the persistent mechanism. PersistenceCriteria This class level encapsulates the behavior required for obtaining, updating, deleting, etc. according to specified conditions. PersistenceMechanism is a class level that encapsulates access methods such as text files, relational databases, object databases. For relational databases, this tree encapsulates complex class libraries, such as Microsoft's ODBC or Java's JDBC, which protects your organization from a problem that changes in these class libraries. PersistentObject This class encapsulates a single instance persistent behavior, and all business objects that require persistence are derived from here. PersistentTrancAction This class encapsulates the simple and behavior required for a long-lasting mechanism. SqlStatement This class level knows how to construct INSERT, UPDATE, DELETE, and SELECT statements based on Classmap objects.

Figure: Hierarchy of persistent layer (I draw with Visio, transfer to JPG)

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

New Post(0)