Skip to main content

Object Managers

Cognibase core software components of Cognibase are called object managers. Those serve as the runtime and memory space where DataItems are hosted and maintained. These managers can be categorized into two main types: the Server Object Manager or just SOM, and the Client Object Manager or just COM.

One characteristic of an Object Manager is that it is able to retain a consistent state of the instances of DataItems within its memory space. In addition, Cognibase follows the Identity Map pattern similar to ORM frameworks; within its memory space only one object instance of an entity with a given primary key (called DataItemKey) exists.

Server Object Manager (SOM)

The Server Object Manager acts as the central component in Cognibase's transactional architecture. It is responsible for orchestrating object transactions—first in an in-memory environment, followed by a persistent data store. The main functions of the SOM are:

  1. Accepts Changesets: It received changesets for by connected clients, readying them for transaction processing.

  2. In-Memory Transactions: Before persisting any changes, SOM validates each changeset against the existing object state according to the Schema and business rules applied as declarative modelling. After validation, it applies these changes into the server's in-memory cache and moves on persisting the state (if needed). In case of runtime only changes (e.g. in runtime Entities or fields) not persistence step is needed.

  3. Data Persistence: Once changes are approved and applied to thee memory space, SOM uses the appropriate Transaction Manager for the configured store (SQL, binary files, etc) to perform the write of the changes.

  4. Transaction Broadcast: After successfully processing and storing a transaction, the SOM disseminates the transaction to the appropriate connected clients to keep them updated.

To bridge the gap between object-oriented designs and relational databases, SOM is equipped with a built-in Object-Relation Mapping (ORM) engine. This allows it to utilize conventional RDBMS systems, among other storage options, as its primary data repositories. Its modular design permits for various SQL and no-SQL databases to be used just by configuration.

Client Object Manager (COM)

The Client Object Manager resides typically within client applications. It is the core component that interfaces directly with the SOM to ensure smooth data flow and management. The main functions of the COM include the following:

  1. Data Retrieval: The COM fetches data items from the SOM through direct read calls, executing queries, or even navigating via associated properties.

  2. Change Detection: Any modifications made to the data items or the addition of new items are meticulously tracked by the COM.

  3. Changeset or Mutations: The COM sends changesets to the SOM for processing.

  4. Transaction Synchronization & Processing: The COM receives transactions from the SOM in real-time, applies the changes to the managed DataItems ensuring its internal memory remains in a consistent and synchronized state. This means, adding newly created items, updating the fields of current ones and "removing the deleted ones". In addition, all tracked Live Collections and References are correctly updated, including addressing any deletions.

  5. Event Firing: For comprehensive tracking, the COM fires standard .NET events, both build-in and custom Cognibase ones, at multiple levels (e.g. instance, type, collection, and COM levels). , ensuring stakeholders remain informed about every data shift.

More on Transaction Processing on COM

The Client Object Manager processes the transactions coming from the server (SOM) taking into account any current mutation that have already occurred in the client, maintaining at most 3 states for each DataItem instance, the local state, the server state and the changes state.