I implement a set of classes and corresponding interfaces, where I want each class to have a set of common properties and a set of specialized properties specific to this class only. So, I am considering defining interfaces line by line:
interface ICommon {...}
interface IWidget1 {...}
interface IWidget2 {...}
I am trying to choose between inheritance in interfaces or in class. Therefore, in particular, I can either do it like this:
interface IWidget1 : ICommon {...}
interface IWidget2 : ICommon {...}
class Widget1 : IWidget1 {...}
class Widget2 : IWidget2 {...}
... or like that ...
class Widget1: ICommon, IWidget1 {...}
class Widget2: ICommon, IWidget2 {...}
Is there any good reason to go anyway?
Update: will this affect the answer if classes should be visible by COM?
source
share