Abstract
Abstract Developer Center
docs.aasii.org

ORM

From ADC

I have established a framework, that maps objects to relations (database rows). It is not automatic unlike Hibernate, but it should be very fast even for large volumes of data.

Contents

Saving

The framework is implemented using Visitor and Builder design pattern for saving and loading respectively. This way it is possible to remove database access code from domain objects. The session object is very close to Facade pattern. It provides complete interface of storage layer to JS controller, which manipulates objects (c++ code can obviously do that as well, see storage/aaStorageTest.cpp).

This call

   session.save(item)

will invoke dispatcher, which determines correct item type using Visitor pattern, asks session for related saveQuery, and dispatches 'item' to the query. saveQuery is the only part of the application, that "knows" how to save specific type of objects.

Loading

Loading is done in a slightly different way. A loadQuery always produces an array of items of a certain type. This time the client of the query knows what objects are ordered. The clients calls

   session.createQuery(queryContractID).load();

to receive a constructed array of objects of required type. session creates the related loadQuery, which passes the constructed array to the client.

Filtering

Reports

Retrieved from "http://docs.aasii.org/ORM"