Resolve the concrete CodeGenDatabaseProvider registered for a given
platform via MJGlobal.Instance.ClassFactory. This is the single source of
truth for platform dispatch — the orchestrator (RunCodeGenBase.setupDataSource())
delegates to this function rather than re-implementing the lookup. Tests
import this function directly so they exercise the real dispatch logic
instead of a transcribed copy.
ClassFactory.CreateInstance returns the abstract base class itself on a
missed registration lookup (it does not throw). We disambiguate by checking
constructor === CodeGenDatabaseProvider and throw a descriptive error so
the failure mode reads as "no provider registered" instead of a cryptic
"is not a constructor" / "is not a function" downstream.
Resolve the concrete CodeGenDatabaseProvider registered for a given platform via
MJGlobal.Instance.ClassFactory. This is the single source of truth for platform dispatch — the orchestrator (RunCodeGenBase.setupDataSource()) delegates to this function rather than re-implementing the lookup. Tests import this function directly so they exercise the real dispatch logic instead of a transcribed copy.ClassFactory.CreateInstancereturns the abstract base class itself on a missed registration lookup (it does not throw). We disambiguate by checkingconstructor === CodeGenDatabaseProviderand throw a descriptive error so the failure mode reads as "no provider registered" instead of a cryptic "is not a constructor" / "is not a function" downstream.