The factory separates the type requested by reusable code from the type actually created, so a test can substitute behavior without editing the environment.
Reason it through
- Factory registration supplies a type proxy.
type_id::create()asks the factory to resolve that proxy using type and instance overrides. - A type override affects every matching creation unless a more specific instance override wins. An instance override affects only a matching hierarchical context.
- The override must be installed before the target
create()call. Factory debug output is the fastest way to prove what the resolver selected.
