Page MenuHomePhabricator

Introduce LanguageConverterFactory service
Open, Needs TriagePublic


Presently, LanguageConverter is constructed by Language directly. This creates a strong coupling between Language and LanguageConverter, which drags in dependencies on Title, among other things.

To avoid this, application logic should use a LanguageConverter directly (or a more narrow interface derived from that class), instead of calling methods in Language that delegate to LanguageConverter. To gain access to an appropriate LanguageConverter for a given language, a LanguageConverterFactory service should be introduced.

Note that Language will (for now) still need a LanguageConverter instance, but it should have no need to call any methods in LanguageConverter that need a Title object. Perhaps a new interface could be extracted that covers just the things that Language needs.