I had to make 7 new entries in my database configuration file, all the time wondering if AppConfig had some means of defaulting across configurations.
So, I began reading the docs to Resources since I remembered that it supported data inheritance. At the time, the idea did not have much relevance, but after my session of cutting and pasting into my config file, I now knew the value of inheritance of configuration data firsthand!
I was bothered by the following quote from the docs of Resources:
Resources defined in a derived class (like Car) override those specified in a base class. <bothersome> Likewise, resources defined in a container class override those specified in the members.</bothersome> In the above example, a default value for "car.speed" in Car overrides the value of "vehicle.speed" in any Car object, otherwise "car.speed" assumes the value of "vehicle.speed". Same for "car.tire.pressure".
It seems like it should be the other way around: the contained elements should refine the general defaults/expectations of the container class with the information specific to their circumstance. For example: if the front wheels of a car should have a tire pressure 5 more psi than the default, then you would set the default in the container class and then "specialize" it to 5 more psi for the front wheels.
But based on the above docs, the container controls the values of the contained, not vice versa.
Does anyone know why?
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.
In reply to should container classes override the value of contained classes (Resources.pm) by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |