On 10/07/2013 11:40 PM, Erik Bernhardson wrote:
Status class:
A review of the code within this class tells me that its primary use
case(its single responsibility if you will) is to assist the caller in
generating user facing error messages about an operation that can fail. If
null/false is an acceptable return value then there is no reason to use
this class.
There are really two parts of the status class:
* Setting error codes of varying severity (e.g. newGood for success,
newFatal for fatal error, error for a regular error), then letting the
caller check for them (e.g. hasMessage(), isOK and isGood, if it's *not*
okay follow-up with getErrorsArray()). Note that hasMessage uses
internal error codes *not* user-facing errors, so it's a way to check
programmatically if a particular type of error occurred.
* Message formatting with wfMessage and friends; indeed, this whould
probably not be in the class if it were designed today, under single
responsibility principle.
I would investigate if you can use just the first.
Matt Flaschen
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l