Hi Arjang,

You can always create new members in the derived class which access the
protected/internal members in the base class so widening the access levels
should be fine. Remember that these access modifiers are really about intent
not security. Anyone can use still reflection-fu to bypass them.

You shouldn't decrease visibility (can you do that anyway? Doesn't that
break polymorphism?).

Regards,

--
Michael M. Minutillo
Indiscriminate Information Sponge
Blog: http://wolfbyte-net.blogspot.com


On Wed, Aug 4, 2010 at 10:22 AM, Arjang Assadi <[email protected]>wrote:

> Are there any rules/guide lines / rules of thumb regarding modifying
> members access modifiers through inheritance?
>
> I can only think of LSP that one should not reduce access level of
> members in a child class respect to it's parent.
>
> What about increasing the access level? e.g. having a protected member
> turned public in the child class? somehow seems wrong, but I can not
> point at the why.
>
> Regards
>
> Arjang
>

Reply via email to