Interfaces, as defined by MSDN “contain only the signatures of methods, delegates or events.” However, since properties are no more than syntactic sugar for a get and set method, they are also allowed in interfaces. My question is – is there any situation where defining properties in an interface is appropriate or should we stick to the scenarios described by MSDN?
Interfaces, as defined by MSDN contain only the signatures of methods, delegates or events.
Share
I think properties are perfectly acceptable in interfaces.
As you said, they really are a get, set, or get and set method. Many interfaces in the Framework define properties, such as IAsyncResult and IWebProxy.