An implementation strategy

One strategy for implementing an in-memory EMdF database (using C++ terminology as an example) would be the following:

  • Have a class which encapsulates the database.

  • Have a class which encapsulates object types. Each object type should encapsulate the features it has, as well as their types. Associate each object type with an object type id and store these in the database class.

  • Have a class called, e.g., CMonad_d (for "database monad"). This represents a monad_m, and has, for each object type, a list of the object id_ds of the objects which have this monad. In the database class, use either an array or an associative map (e.g., std::map) which associates each monad_m with its CMonad_d.

  • Have a class which encapsulates objects, their monads, and their feature values. You can choose either to make the class generic, capable of handling all object types, or to subclass it for each object type in your application domain.

  • For each object type, use some sort of associative map (e.g., std::map) which maps id_ds to pointers to object objects, and put these in the database class. You may wish to put all of the objects in one big map, regardless of object type.

This should serve most needs.


Previous:An example application
Up:An in-memory EMdF database
Next:Please contribute