[Mono-list] Not implemented exceptions in Getters
curylod at asme.org
Sat Jul 12 00:07:17 UTC 2014
On Friday, July 11, 2014, Kevin Connell <kevin at connells.net> wrote:
> Is throwing a NotImplementedExceptions an appropriate pattern in a getter?
Not really an appropriate pattern, no. Which classes were these? Part of
the mono framework?
"Avoid throwing exceptions from property getters.
Property getters should be simple operations without any preconditions. If
a getter might throw an exception, consider redesigning the property to be
a method. This recommendation does not apply to indexers. Indexers can
throw exceptions because of invalid arguments."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list