The Lotus C API Toolkit is a series of Notes/domino-based API programming interfaces and data structures published by Notes/domino, which allows users to develop autonomous applications to access the Domino database, which is widely used in Domino two development The application. The memory management mechanism of the Lotus C API is one of its core components and is essential for developing efficient and practical Domino applications.
This paper introduces in detail the storage structure of Domino database in memory, and the common data structure and API interface provided by Lotus C API for memory management, and illustrates how to follow its memory management mechanism for efficient and practical application development.
Domino Database model
Before introducing the Lotus C API memory management mechanism, first look at the storage model of the typical Domino database (Figure 1). A Domino database consists of the header information of the database and multiple note data structures. The database header information includes title, Categories, class, Design class, ID, Replica info, and so on to describe the relevant properties of the database. The header information is followed by multiple note data structures. Note is a general data structure used by Domino/notes for storage and various information. Note can be divided into design notes (forms, views, folders, navigators, outlines, pages, framesets, agents, and resources), data docume NTS, profiles documents, access control List and collections (indexes). A note can also be divided into note header information and multiple item. Note Header information includes database handle, note ID, originator ID, note class, note flag, and so on. The item in note consists of multiple attributes, such as item name, type, length, and the content of the stored data information.
As shown in Figure 1, the Lotus C API Toolkit uses the "container" (container) model to construct the Domino's database storage model: A Domino database can contain multiple notes, each note contains multiple item, and so on. When you close a container object, all objects contained within the container are automatically closed and released. For example, if you call the Lotus C API to open a database and create a document in the database, when the database is closed, the created document is closed and the storage space is freed. Therefore, it is important to note that before closing the container object, be sure to save the object contained in the container. In addition, when the Lotus C API function notesterm is called to end a Notes session, all memory allocated during the Seesion cycle is freed.
This article turns from: IBM developerWorks China
Please click here to view the full text