Page MenuHomePhabricator

[ES-M5] [EPIC] Migrate EntitySchema to use the MediaWiki Service Container
Open, Needs TriagePublic

Description

Context

Currently, all services in the EntitySchema extension are instantiated sporadically and on demand in various implementation classes. However, in order to increase testability and decrease coupling between classes in the codebase, it would be advisable to implement a Dependency Injection pattern.

Luckily, MediaWiki offers a way to register services in it's MediaWikiServices container, to allow us to implement dependency injection while still leveraging the registration of handler classes for common integrations, such as Content Handling, Special pages, API Modules and hook registration.

For more information about the MediaWiki service container, see:

Main Objectives

Similarly to what was done for the WikibaseRepo and WikibaseClient extensions in T268600: Implement services through MediaWikiServices, we would like to register each of the services instantiated in the Entity Schema content handler classes, action classes, hooks and special pages with the MediaWiki service container. This involves:

Considerations

While a bulk of this work will most likely be completed with upcoming feature development in EntitySchema, it is pivotal that the migration is complete, in order to ensure consistency in the patterns employed in the codebase and avoid degradation of the codebase's comprehensibility by mixing various code organization ideas.

Event Timeline

ItamarWMDE renamed this task from [EPIC] Migrate EntitySchema to use the MediaWiki Service Container to [ES-M5] [EPIC] Migrate EntitySchema to use the MediaWiki Service Container .Sep 20 2023, 2:32 PM