Following my other question, is there a general rule of thumb, when we should pass a setting-like value, that controls class' behavior (for example displayed texts) as as class' constant or variable, one-by-one, and when it is better to "pack" them to one associative array? Or is it just a choice of the developer?
For example -- is this approach better (PHP code):
class SomeClass
{
public $errorIncorrectProtocol = 'Please, don't use GET protocol in this context!';
public $errorMissingId = 'The ID can't be empty or equal zero...';
}
than this one:
class SomeClass
{
public $errorMessages = array
(
'IncorrectProtocol'=>'Please, don't use GET protocol in this context!',
'MissingId'=>'The ID can't be empty or equal zero...'
);
}
and if yes -- then, why?