Eric Lippert just wrote a blog on this topic .
The main point is to ensure that the class can βtrustβ the protected method's caller. Classes that share a common base class, even if this common base defines a protected method, are essentially unfamiliar in this regard.
Eric's example is based on the idea of ββa banking application. Instead of recreating his example, I simply spew it here:
While what you imagine seems futile if it were allowed, the kind of shenimans you see here would be possible. Right now, you know that a call to a protected method either comes from your type (which you control), or from a class that you directly inherit (which you know at the time of compilation). If it was open to anyone inherited from the type of declaration, then you will never be guaranteed to find out the types that your protected method might call.
While you initialize your BaseClass variable BaseClass instance of your own class, the compiler only sees that the variable is of type BaseClass , placing you outside the circle of trust. The compiler does not analyze all destination calls (or potential destination calls) to determine if it is βsafeβ.
Adam robinson
source share