I'm having a little problem designing an
I have (not the GUI).
What I basically have is two
that do the same, but one of them needs to get an extra parameter to a
Public Interface IDoSomething(Of T)
Function DoSomething(ByVal something As T) As String
Public Interface IDoSomethingSlightlyDifferently(Of T)
Inherits IDoSomething(Of T)
Function DoSomething(ByVal s As String, ByVal something As T) As String
The above is not impossible, but the
now has an overload for the
. One that will never be called...
is to be used and implemented by the user and another
as an input parameter.
is to be called from some
code (which calls the overloaded function).
So while both
serve the same purpose the manner in which they are called is different. Does that mean one should not
the other? Or should I Inherit them and simply have an empty
that throws a
Actually, as I wrote this I think I found my own answer.
are probably never interchangeable. You either
one and the other will never be called or you
both and you now have a
that does two things (which look the same, but are still slightly different). So I guess the answer is they shouldn't
I'm still curious and looking forward to some of your opinions on this matter. It's something that has been bugging me for a while.