Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!argosy!kentb From: kentb@argosy.UUCP (Kent Beck) Newsgroups: comp.lang.smalltalk Subject: Re: Access methods - New feature ? Message-ID: <1264@argosy.UUCP> Date: 26 Apr 91 18:40:02 GMT References: <1991Apr21.221149.8057@vuse.vanderbilt.edu> <4753@m5.COM> Sender: news@argosy.UUCP Reply-To: kentb@shark.UUCP (Kent Beck) Organization: MasPar Computer Corp, Sunnyvale CA Lines: 15 Tim Atkins writes: "Another point that has not been made is that good OO programming style asserts that instance variables should always be accessed indirectly through methods, even by methods of the same class and its subclasses." This is only true in the presence of private methods. In Smalltalk if you choose to use the above style in a class and its subclasses you cannot reasonable prevent external reliance on the same structure information. I choose to accept the occasional hassle of doing an inst var refs and adding a few "self "s rather than expose all of my instance variables to raping and plundering. Purists will say that Smalltalk should have private methods- well the one I make my living on now doesn't, so I make do with what I have. Kent