company logo

ObjectSpace :: objectSpaceContext - Get object space context

The function returns the object space context. This is either an application specific context class instance or an instance of the common database context class ( ObjectSpaceContext ).

The object space context class can be used in order to call actions (business rules) implemented in the context class from within an application.

The object space context is mainly used in order to support global actions, that do not depend on specific database instances. For most applications, it is sufficient to use either the object space or the database context ( DatabaseContext ).

// fragment: ObjectSpace  osh;

  const ObjectSpaceContext   &osc = osh.databaseContext();

  osc.executeAction("lastUse");

  output(osc.result());

Notes:

One cannot create a copy handle from a context object, i.e. one must not assigne context class object on value level.

Return value:  Object space context ( odaba::ObjectSpaceContext & )

Object space context usually refers to an instance of an application defined object space context class for the current object space. When no Object space context has been defined in the application, the context refers to the default database context class.

Implementation details

odaba::ObjectSpaceContext & ObjectSpace  :: objectSpaceContext (  )