Ferreteria/v0.5/portbank: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(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...")
 
No edit summary
Line 1: Line 1:
=Data Object Management=
=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).
v0.5 includes a [[wooz:2021/11/08/data objects refactoring|significant refactoring of how database-related objects are 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==
==Databases==
Creating a database requires a database spec (<code>ferret\data\cDatabaseSpec</code> descendant).
Creating a database requires a database spec (<code>ferret\data\cDatabaseSpec</code> descendant).
 
Changes:
* Instantiation was formerly done by <code>cDatabase::Instantiate()</code>, which used an internal static table to look up the <code>cDatabase</code>-descendant to instantiate from a slug returned by <code>cDatabaseSpec->GetTypeString()</code>.
* I suddenly realized that this makes no sense:
** the cDatabaseSpec-descendant should just return the class it wants to use, from <code>->GetDatabaseClass()</code>
** <code>cDatabaseSpec</code> can instantiate directly, e.g. <code>cMainDBSpec->MakeDatabase()</code>.
** <code>cDatabase</code> should be named <code>caDatabase</code>, {{l/ferreteria/|coding|because}} it is abstract.

Revision as of 18:44, 8 November 2021

Data Object Management

v0.5 includes a significant refactoring of how database-related objects are 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).