There are several methods in PropObject that are stub methods with no logic, namely: getPropsForArchivalExtra, initProps, getPropValue and setPropValue.
getPropsforArchival arguably is fine as is, but I believe it would be improved if it was made to return an empty array instead. Functionality would remain the same, just a reduced null pointer.
The other three are the actual one that I wanted to make the issue about. These three are all basic methods that, given that they are at the base class of every single view in the library, seem quite essential to have, but they are currently stubs that will quietly fail if they weren't implemented by one of PropObject's descendants. This seems to me to be a large problem, as any implementor cannot assume that these are intrinsic parts of the library, even though they should be. To resolve this, I have three potential solutions:
- Provide a default implementation.
- Make these methods abstract.
- Throw some sort of "NotImplementedException" exception by default.
As PropObject is an abstract class, there is no problem with the methods also being abstract, but the stated purpose of PropObject is to provide Prop support to child classes, so I do feel that it should provide a default implementation. Nothing wrong with then overriding it, but a method call shouldn't silently fail on fresh implementation. The third option is a poor replacement, but is better than an empty stub that says nothing.
My making the issue doesn't mean you need to do this btw, I'll slot it into the existing #14 pull request once I know what your thoughts are.
There are several methods in PropObject that are stub methods with no logic, namely:
getPropsForArchivalExtra,initProps,getPropValueandsetPropValue.getPropsforArchivalarguably is fine as is, but I believe it would be improved if it was made to return an empty array instead. Functionality would remain the same, just a reduced null pointer.The other three are the actual one that I wanted to make the issue about. These three are all basic methods that, given that they are at the base class of every single view in the library, seem quite essential to have, but they are currently stubs that will quietly fail if they weren't implemented by one of PropObject's descendants. This seems to me to be a large problem, as any implementor cannot assume that these are intrinsic parts of the library, even though they should be. To resolve this, I have three potential solutions:
As PropObject is an abstract class, there is no problem with the methods also being abstract, but the stated purpose of PropObject is to provide Prop support to child classes, so I do feel that it should provide a default implementation. Nothing wrong with then overriding it, but a method call shouldn't silently fail on fresh implementation. The third option is a poor replacement, but is better than an empty stub that says nothing.
My making the issue doesn't mean you need to do this btw, I'll slot it into the existing #14 pull request once I know what your thoughts are.