Subsections

The Object Model

The EYEDB object model is inspired by the SmallTalk, LOOPS, ObjVlisp, Java and ODMG models.

The main three class abstractions are the class object which is the root class, the class class and the class instance as shown in Figure 2.

Generally speaking, the instantiation of a class X gives an instance of the class X.
Figure 2: Partial Native Object Model

An instance cannot be instantiated except the instances of the class class or its subclasses: the instantiation of an instance of the class class is an instance of the class instance (i.e. an instance of the class instance).

If new() denotes the instantiation method:

struct_class Person =
struct_class->new(name = "Person", ...)

Person is an instance of the class struct_class that can be instantiated:

struct john =
Person->new(name = "john", age = 32)

john is an instance of the class struct that cannot be instantiated

struct_class Employee =
struct_class->new(name = "Employee",
parent = Person, ...)

struct henry =
Employee->new(name = "henry",
salary = 10000)

Figure 3 shows this instantiation mechanisms.

Note that as the class class derives from the class object, an instance of the class class can be manipulated like any instance of the class object.

The native EYEDB object model is composed of 76 classes such as the class collection, the class method, the class constraint, the class index, the class image and so on.
EYEDB object model supports all standard built-in types: 16-bit, 32-bit and 64-bit integer, character, string, 64-bit float.

An instance can be transient or persistent: A persistent instance can be object or literal:
Figure 3: Applicative Object Model Example

Class Structure

A class is composed of a name, a parent class (except for the class object which is the root class), a set of attributes, a set of methods and a set of triggers:

Type Polymorphism

The two language bindings, C++ and Java, and EYEDB OQL supports type polymorphism: variables may be bound by instances of different types.
This is a direct consequence owing to the fact that any EYEDB class inherits from the class object,

The possibility of manipulating polymorphic objects is a major contribution of object orientation.

The Collection Type

A collection is composed of elements of the same type.
The elements can be either literal or object.

If the collection element type is the class object, then the collection can contain instances of any class, as all classes inherit from the class object.

The collection types supported by EYEDB are the set, the bag and the array: The collection type is a major concept of the EYEDB object model.

Relationships

The EYEDB object model supports only binary relationships, i.e. relationships between two types.
A binary relationship may be one-to-one, one-to-many or many-to-many depending on the cardinality of the related types. Relationships are not named.

EYEDB maintains the referential integrity of relationships. This means that if an object that participates in a relationship is removed, then any traversal path to that object is also removed.
EYEDB supports object-valued attribute: this kind of attribute enables one object to reference another without expectation of referencial integrity. An object-valued attribute implements a unidirectionnal relationship: in this case, EYEDB does not guarantee the referential integrity. Note that such a unidirectionnal relationship is not called a relationship.

The example introduced in the section The Object Definition Language illustrates the use of relationships and object-valued attributes.

Constraints

EYEDB supports all standard constraints:
EyeDB manual