Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
There’s a subtle but important difference between protected access in unmanaged C++ and protected access (i.e. family) in the CLR. The difference is due to the CLR’s ability to build security guarantees on top of type safety.
Imagine you had a bifurcated hierarchy:
Class A { protected M }
/ \
Class G : A Class X : A
There is no relationship between X and G, except for the fact that they both derive from A. We don’t allow X to access A.M on instances of type G and we don’t allow G to access A.M on instances of type X. Instead, X can only access A.M on instances of X and instances that are subtypes of X.
The most efficient way for us to enforce this is to require a cast to X before accessing A.M from any of X’s methods. Of course, we only require this in verifiable code.
Comments
- Anonymous
May 31, 2009
PingBack from http://portablegreenhousesite.info/story.php?id=182 - Anonymous
June 09, 2009
PingBack from http://cellulitecreamsite.info/story.php?id=2562 - Anonymous
June 15, 2009
PingBack from http://mydebtconsolidator.info/story.php?id=1325 - Anonymous
June 16, 2009
PingBack from http://topalternativedating.info/story.php?id=12426