I have two interfaces; ISetandISet<T>
Both implement Add, Remove, and Clear, but with different types of arguments; object and T.
Now I have two options. Either let it ISet<T>inherit from ISet, or let isolate them from each other.
One of the benefits of using ISet<T>inheritance from ISetis, of course, that I can always use ISet<T>where I need it ISet. But at the same time I also need to add a “new” modifier to members with a T parameter. I don’t really like the “new” modifier, but maybe this is the best option in this case?
It seems strange to have ISet<T>, which is also not ISet. This is a logical assumption. I can’t say why I don’t like the “new” modifier. This is like "goto" - a keyword. I just try not to use it.
Do you think I should go here? Inherit or not?
In .NET, we have ICollection<T>and ICollectionthat are not inherited. Also not performed IList<T>and IList. But IEnumerable<T>inherits from IEnumerable.
I know about an ISet interface that already exists (this was just an example)
source
share