Ferreteria/v0.5/portbank
< Ferreteria | v0.5
Jump to navigation
Jump to search
Data Object Management
v0.5 includes a significant refactoring of how database-related objects are created and managed. The goal was to simplify access to global singleton objects in general, and databases and tabloids in particular, while retaining flexibility (e.g. for different applications to determine the database in which each table is stored).
Databases
Creating a database requires a database spec (ferret\data\cDatabaseSpec
descendant).
Changes:
- Instantiation was formerly done by
cDatabase::Instantiate()
, which used an internal static table to look up thecDatabase
-descendant to instantiate from a slug returned bycDatabaseSpec->GetTypeString()
. - I suddenly realized that this makes no sense:
- the cDatabaseSpec-descendant should just return the class it wants to use, from
->GetDatabaseClass()
cDatabaseSpec
can instantiate directly, e.g.cMainDBSpec->MakeDatabase()
.cDatabase
should be namedcaDatabase
, because it is abstract.
- the cDatabaseSpec-descendant should just return the class it wants to use, from