This page describes thing related to services in MediaWiki. See also: Dependency Injection.
General service typesEdit
MediaWiki has a few common service types. This section describes them and identifies for which purpose they can be used.
- This is service can, as its name implies, store and retrieve things.
- There are two kinds of factories, both of which may be used within the same class:
- Create an object if it does not exist yet and return the same object when provided with the same parameters.
- Create a new object every time the method is invoked.
- This service provides information about a given thing, as an addition to the object. It does not create objects itself unless the object is auxiliary.
- This service manages things. It can optionally retrieve the things too.
- This service is a read-only storage for looking up things. The things are often predefined elsewhere and do not change during runtime.