EiffelStore Implementation Layer
Each interface class has an implementation counterpart that implements specific DBMS handling. The class prefix indicates clearly its layer, for instance:
- DB_SELECTION is the interface to perform a database selection query.
- DATABASE_SELECTION [ [[ref:libraries/store/reference/database_flatshort|DATABASE]] ] is its implementation.
The abstract DATABASE class represents a DBMS, i.e. it is the Eiffel-side database call interface. It is inherited for instance by the instantiable
EiffelStore enables to link common interface objects with database-specific implementation objects using a handle. This handle also enables to switch between different databases.
Let us see in 4 steps how EiffelStore implements this handle system:
The active database handle
The
- Database login information:
login: LOGIN [DATABASE]
-- Session login
- Database status information:
status: DB_STATUS
-- Status of active database
Association between interface and implementation
The association between an interface object and its implementation counterpart is done at the interface object creation.
Every interface class inherits from the
The creation procedure for a make
-- Create an interface object to change active base.
do
implementation := handle.database.db_change
create ht.make (name_table_size)
implementation.set_ht (ht)
end
Access to the DBMS call interface
Every implementation class can access the active database call interface by inheriting from the
Active database selection
As seen in the interface connection part, active database selection is performed by the {
Let us give some details about the set_base feature:
- Database call interface global reference is updated through {
HANDLE_SPEC }.update_handle . - All information about the database is set to the handle, mainly:
- Login information.
- Status information.
The corresponding code looks like: session_status: DB_STATUS
-- A session management object reference.
...
set_base
...
update_handle
if session_status = Void then
create session_status.make
end
handle.set_status (session_status)
...