Currently, API modules and special pages are registered using class names, and instantiated with a fixed set of parameters to the constructor. This makes proper dependency injection impossible. The solution is to allow factory functions for registering such modules. That would give the implementor full control over the constructor arguments.
The same approach is already used with the new ConfigFactory. ContentHandler uses a hook to achieve the same.
Version: unspecified
Severity: enhancement
Whiteboard: u=dev c=backend p=0