Note that there are some explanatory texts on larger screens.

plurals
  1. USJeff
    primarykey
    data
    text
    plurals
    1. CO@Martin: Right, that is the effect that I want and sometimes actually use already, where A is actually a reciprocally friended interface to some restricted access class Z. The common complaint with the normal Attorney-Client Idiom seems to be that the interface class A has to boilerplate call wrappers to Z, and in order to extend access to subclasses, A's boilerplate has to be essentially duplicated in every base class like B. An interface normally expresses what functionality a module wants to offer, not what functionality in others it wants to use itself.
      singulars
    2. CO@Martin: Right, in this scheme the friended base could be used to get at the friending class, which could be simple encapsulation violation in many (if not most) cases. However, in situations where the friended base is an abstract class, any derived class would be coerced into implementing a reciprocal interface of its own. I'm not sure whether an 'impostor' class in this scenario would be considered to be breaking encapsulation or to be violating an interface contract if it didn't try to faithfully act its claimed role properly.
      singulars
    3. COFriendship, although given through declarations like members, aren't really members so much as notifications of which other classes can essentially ignore the visibility classifications on 'real' members. While the spec sections you quote explain how the language operates regarding these nuances and frames behavior in self-consistent terminology, things could have been crafted differently, and nothing above gets to the heart of the rationale, unfortunately.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload