Ex-Mente / auxi.0

GNU Lesser General Public License v3.0
8 stars 8 forks source link

Re-think _validate_params_ #194

Open alchemyst opened 7 years ago

alchemyst commented 7 years ago

At the moment _validate_params_ is redefined by classes inheriting from Object and NamedObject. However, to use it correctly, it is necessary for the inheriting object to know what the arguments should be. At the moment, this mostly means knowing you're calling NamedObject._validate_params_ because you know it will take a name and description as an argument. This makes handling the class hierarchy overly brittle.

I suggest that we remove Object._validate_params_ and rename NamedObject._validate_params_ to something like _validate_names_ which can be sucessfully called (as self._validate_names_(name, description) on all objects which inherit from NamedObject.

alchemyst commented 7 years ago

I've created a more detailed discussion here