On 11/12/13 4:18 PM, Dicebot wrote:
On Wednesday, 13 November 2013 at 00:03:49 UTC, Jakob Ovrum wrote:
But alright, it is not a good factory.
Well, D compile-time reflection allows to define factory that finds all
classes that implement given interface and provides them for
construction, with no explicit list.
I don't think all classes in a system are discoverable during
compilation. This is the part of Object.factory that is not easy to
replace. There must be a global map somewhere and a per-module
registration during initialization.
Andrei