Ferreteria/v0.5/portbank

From Woozle Writes Code
< Ferreteria‎ | v0.5
Revision as of 17:19, 8 November 2021 by htyp>Woozle (Created page with "=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 o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 the cDatabase-descendant to instantiate from a slug returned by cDatabaseSpec->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 named caDatabase, because it is abstract.