-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tim Starling wrote:
MessageCache is a cache of the MediaWiki namespace, a
cache which is
conceptually merged with various other message sources. Sometimes Language
needs to access the MediaWiki namespace, and it does so via MessageCache.
Language::getMessageFromDB is a helper function to facilitate such access.
This is required to support important features such as per-wiki
customisation of month names.
Ah, when put in that context, that makes sense. Not such an ugly hack,
then. (referring to the docblock on line 335 of Language.php)
The way MessageCache supports multiple language
objects is hackish,
because the ability to support multiple language objects was added after
MessageCache was designed, and it was never properly refactored.
After refactoring, what would MessageCache look like? Would you have all
the language objects cached in their own registry? This has a
relationship to the key/lang syntax?
The object is named after the data it contains. The
member functions are
tools for operating on that data. We could call it MessageUtilities, but
then it would sound like a mere collection of functions, and it would not
be clear what happens when you instantiate, clone or serialize one of them.
In that context, the name makes sense. However, there are still quite a
bit of methods that aren't really tied to that. What if you seperated
the less related methods (get() stands out as one) into
MessageUtilities, so that only methods directly manipulating the
MediaWiki cache are in the MessageCache object. An extra file, yes, but
possibly the difference between caching MediaWiki messages, and
retrieving a message from multiple sources is sufficiently great enough
to merit another include.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFFvnK5qTO+fYacSNoRAlZSAKCGcJL/ktye30PCcjaJrTikm7S7tgCfdXPW
ndBJCSvibmBk6D25BU7RyoA=
=JNC4
-----END PGP SIGNATURE-----