2021/11/08/data objects refactoring: Difference between revisions
Jump to navigation
Jump to search
(Created page with "I'm making some changes to the data objects management system for Ferreteria v0.5. ==at present== Database instantiation is currently done by <code>cDatabase::Instantiate()</c...") |
No edit summary |
||
Line 1: | Line 1: | ||
I'm making some changes to the data objects management system for Ferreteria v0.5. | I'm making some changes to the {{l/ferreteria/|v0.5/data objects|data objects management system}} for {{hashtag|Ferreteria}} v0.5. | ||
==at present== | ==at present== | ||
Database instantiation is currently done by <code>cDatabase::Instantiate()</code>, which uses an internal static table to look up the <code>cDatabase</code>-descendant to instantiate from a slug returned by <code>cDatabaseSpec->GetTypeString()</code>. | Database instantiation is currently done by <code>cDatabase::Instantiate()</code>, which uses an internal static table to look up the <code>cDatabase</code>-descendant to instantiate from a slug returned by <code>cDatabaseSpec->GetTypeString()</code>. |
Revision as of 18:41, 8 November 2021
I'm making some changes to the data objects management system for #Ferreteria v0.5.
at present
Database instantiation is currently done by cDatabase::Instantiate()
, which uses 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 namedcaDatabase
, because it is abstract.
TO DO
- rename
cDatabase
tocaDatabase
- rename
cDatabaseSpec
tocaDatabaseSpec
- replace abstract
caDataSpec->GetTypeString()
method withcaDatabaseSpec->GetDatabaseClass()
- write
caDatabaseSpec->MakeDatabase()