Last modified: 2014-10-30 19:33:12 UTC
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.
I note this was tried before in Gerrit change #49781, and abandoned because it turned out to be too much work at the time.
Already fixed? - api part maybe Gerrit change #149183 - special page part maybe Gerrit change #152755