Wout Er wrote:Thanks for the links Ritchie. I've seen the simplified version of the docs before, and I'll check the more detailed version when I have the time :-).
I know the access issue is due to the protected access modifier. I'm just wondering about the rationale behind this design decision, since I think it's strange to allow classes in the same package to do the access on a non-this reference, but allowing subclasses in another package not to...
Henry Wong wrote:
if the variable had been a Boo instance (and reference), then it would have been allowed to access the protected resource defined by the Roo class.
Wout Er wrote:Henry, thanks for pointing this out and luckily this works! Still, I don't see the rationale for why it doesn't work on a Roo-typed reference within subclass code in another package, while it does within any code in the same package.
Wout Er wrote:
Henry Wong wrote:
if the variable had been a Boo instance (and reference), then it would have been allowed to access the protected resource defined by the Roo class.
Henry, thanks for pointing this out and luckily this works! Still, I don't see the rationale for why it doesn't work on a Roo-typed reference within subclass code in another package, while it does within any code in the same package.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |