If an implementation is virtual and a base object has been derived several
times by others it can be hard to figure out exactly where the call goes.
With an explicit implementation the call always hits the call in the base
class - makes it easier to debug.
This approach has saved me a load of time with remoted calls.
ie.
interface I
{
void MyCall();
}
Derived6: Derived5
{
}
Derived5:Derived4
{
override void MyCall()
{
// Do stuff
base.MyCall();
}
}
Derived1:Base
{
override void MyCall()
{
// Do stuff
}
}
....
Base : I
{
virtual void MyCall()
{
}
I.MyCall()
{
// Always gets trapped here
this.MyCall(); // If you just called MyCall without explicit
implementation you'd have to hunt through every class that derives from Base
to find where a call to MyCall actually ends up.
}
}
Cheers,
Adam.
"puzzlecracker" <ir*********@gmail.comwrote in message
news:36**********************************@d10g2000 pra.googlegroups.com...
>I don't see the purpose of explicit interface implementation other
than to hide its signature in the class that implements it, and,
instead, write your own, perhaps with a different signature,
implementation. Also, if you implement more than two interfaces with
the same method, which is rarity in practice or so it seems. To me
it appears a shallow end... Am I missing something?
Thanks