- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
RE: For the first time, I see the problems with making "public" the default access for members
Mon, 2011-06-20, 08:40
> > However, now I'm in a situation where I have a root class, and five
> > or so subclasses of it that implement most of the non-public methods.
> > And I've found that while my access settings are correct in the root
> > class, I've managed to forget quite a few of them in the subclasses
> > and am having to go through and check everything by hand. Ugh.
> >
> > Maybe we could have a new keyword that says access restrictions must
> > apply to subclasses? How about "definitely protected foo...". I like
> > the sound of "definitely".
>
> What sub-class / super-class protection relationship do you want? The
> LSP dictates only relaxation in subclasses, never tightening.
I understand that neither 'relaxation' nor 'tightening' is the aim.
'Tightening' is no topic, but unwanted 'relaxation' is the problem.