GlobalObjects
Loading...
Searching...
No Matches
GlobalObjects 1.0.8

Introduction

GlobalObjects is a C++ object-oriented database (OODB, ODBMS, NoSQL) for maintaining C++ objects persistence. Single and multi-user operation via a server is possible.
C++ objects can be saved, loaded and deleted easily. This can also be done in transactions, which can be confirmed (actions are executed) or cancelled (actions are not executed). The ACID principle is consistently adhered to.
GlobalObjects understands C++ class declarations with support for encapsulation, inheritance, polymorphism, object identity, and object references.
There is an extensive locking mechanism to protect stored objects.
In order to "notice" changes to the object inventory, a simple notification system, implemented by passing a callback function, can be used.
The main focus is on the easy saving and loading of even complex C++ objects with their references and the updating of loaded objects in memory when they are changed in the database.
The name GlobalObjects was chosen because it helps the developer to automatically synchronize objects across multiple clients. The application developed with GlobalObjects still works without any changes in single-user operation.
Microsoft Visual Studio (from version 2010) and MinGW (from version 5.3.0) are currently supported on Windows and gcc (from version 4.8.3) and Clang (from version 6.0.0) on Linux. For example, you can install a GloServer on a supported operating system and access it from all supported operating systems with a client application.

Alternatives for saving C++ objects

To be able to persistently store C++ objects from the memory of the computer, there are roughly three possibilities:

  • Serialize on a data carrier such as a hard disk or SSD.
  • Convert to a relational model and store it in a conventional relational database.
  • Save directly to an object database.

Concept of GlobalObjects

GlobalObjects goes the way, that the C++ objects are stored like in an object database, but the storage is done in the file system of a disk. In a later stage it is planned to store the objects in a SQL database such as SQLite.

A database design does not have to be made for GlobalObjects.

Features

Here a short outline of the possibilities of GlobalObjects:

Store, load and delete

With GlobalObjects a direct saving, loading and deleting of C++ objects in an object database is possible. Both single and multiple inheritance of C++ is supported. An AllSet (the set of all stored objects of the class) is available for each class. When loading an object from an AllSet the real object is instantiated, which may be derived if necessary (loading an object from the AllSet of the "Animals" instantiates the respective objects e.g. of the type "Fish" and "Bird" etc.).
It can be set whether referenced objects should be loaded, saved or deleted with.

Example:

...
#include <GloBase.h>
// The persistent classes are included by the object creator.
#include "FirstBaseObjCreator.h"
...
MyFirstBaseObjCreator t_ObjCreator;
glo::Base t_Base( "LOCAL", "ClientName", "FirstBase", t_ObjCreator ); // without server
// glo::Base t_Base( "HOSTNAME", "ClientName", "FirstBase", t_ObjCreator ); // with server (HOSTNAME)
...
if ( t_Base.openBase() == 0 )
{
int t_iErr = 0;
// new object of type FirstPersClass; glo::Forgeter<FirstPersClass>()is passed too
std::shared_ptr<FirstPersClass> t_NewPersObject( new FirstPersClass(), glo::Forgeter<FirstPersClass>() );
// Register the object with the object database, the object gets a valid object ID (see glo::ObjID) and...
if ( t_NewPersObject->assign( t_Base ) == 0 )
{
// ...simply save it. If no error is the complete object in the object database.
t_iErr = t_NewPersObject->store();
}
...
std::shared_ptr<FirstPersClass> t_PersObject;
glo::TAllSet<MyFirstClass> t_AllSet( t_Base );
t_iErr = t_AllSet.get( t_PersObject, glo::START ); // gets first object from the AllSet in t_PersObject
// do something with t_PersObject...
...
// ... and save it again
t_iErr = t_PersObject->store();
...
// ... respectively delete it in the object database
t_iErr = t_PersObject->deleteInBase();
...
t_Base.closeBase()
}
This class is the interface to the persistent objects. Here "objects" can be registered,...
Definition GloBase.h:250
Especially for GenericPersistent or derived classes of Persistent the Forget method for std::shared_p...
Definition GloTypes.h:1249
AllSet, which returns objects from the database.
Definition GloTAllSet.h:171
@ START
Definition GloTypes.h:177

References

References such as pointers, also in containers, to other objects in the object database are offered for reference navigation. You can specify whether the referenced objects are loaded (instantiated) with the object or only when they are accessed (see also glo::TOndemand, glo::TOndemandList and glo::TOndemandSet). You can also set a dependency (dependent) so that referenced objects are saved or deleted at the same time. More...

Locking procedure

To ensure multi-user access, a locking mechanism is implemented down to the object level. Both sets of objects and individual objects can be locked in many ways. More...

Transactions

In order to guarantee that several object database actions can be carried out in a closed manner, transactions are made available. Nested transactions are supported. More...

Watch and notify

An easy-to-use notification system is provided so that changes to objects in the object database can be noticed by an application, e.g. to keep the objects in memory consistent. More...

Indices

To find objects using attribute values, it is possible to index objects using their attributes. It is possible to index objects using your own attributes, attributes of superclasses, and attributes of referenced or embedded classes. You can combine attributes such as "last name" and "first name" as one index attribute. More...

Supported data types

Most standard types are supported as embedded attributes. Currently, these data types are provided for persistent objects.

GlobalObjects error codes

So that the developer can classify any errors that may occur, they are explained here.

License

GlobalObjects is free software:

GNU Affero General Public License Usage
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Please review the following information to ensure the GNU Affero General Public License version 3 requirements will be met: https://www.gnu.org/licenses/agpl-3.0.en.html

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.