ObjectFactory

  creates objects from specifications (via  or ). This format is used by certain configuration settings (such as  or ). A typical specification looks like this:

which is the specification for  .

Other options include:

With 
Starting with , ObjectFactory now supports creating classes with services specified in the spec. To use ObjectFactory to create classes that need services, you'll need to use the ObjectFactory service, and call the <tvar|1> </> method.

For non-MediaWiki uses, an ObjectFactory instance can be created with a [<tvar|url>https://www.php-fig.org/psr/psr-11/</> PSR-11 Container interface] that will be used to retrieve the services.