User:Daniel Kinzler (WMDE)/MW Refactor

From mediawiki.org

Goal[edit]

Refactor MW core to become more modular. Split off some parts into separate libraries. This enables

  • More code re-use
  • Easier maintenance
  • More flexibility to replace bits and pieces with alternative implementations or external services.

Principles[edit]

Primary principles:

  • Application logic shall not depend on global state
  • There shall be no circular dependency between classes

Corollary principles:

  • Hint against narrow interfaces only. Callers with different needs should not hint against the same interface.
  • Avoid using "kitchen sink" objects that depend on lots of things.
  • Global variables and global service instances must be accessed only in static entry points.
  • Inject all services and settings needed by a class via the constructor.