Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    I vaguely recall there being some semi-commonly used class in C# that implements an interface but explicitly states in the documentation that a certain method is not implemented. I'll try to see if I can find it. Commented Dec 29, 2015 at 17:37
  • I'd definitely be interested to see that, if you can find it. Commented Dec 29, 2015 at 17:41
  • 24
    I can point out multiple cases of this in .NET's library - AND THEY'RE ALL RECOGNIZED AS BAD TERRIBLE MISTAKES. This is an iconic and common violation of the Liskov Substitution Principle - reasons not to violate LSP can be found in my answer here Commented Dec 29, 2015 at 20:53
  • 3
    Are you required to implement this specific interface, or could you introduce a superinterface and use that? Commented Dec 29, 2015 at 22:15
  • 6
    "one property that is unnecessary for this class" - Whether a part of an interface is necessary is up to the clients of the interface, not the implementers. If a class cannot reasonably implement a member of an interface, then the class is not the right fit for the interface. This may mean that the interface is poorly designed - probably trying to do too much - but that doesn't help the class. Commented Dec 31, 2015 at 0:01