Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!argosy!kentb From: kentb@argosy.UUCP (Kent Beck) Newsgroups: comp.lang.smalltalk Subject: Re: Access methods - New feature ? Message-ID: <1260@argosy.UUCP> Date: 25 Apr 91 21:35:17 GMT References: <1991Apr21.221149.8057@vuse.vanderbilt.edu> <1991Apr23.010026.25098@ccs.carleton.ca> <2273@media03.UUCP> Sender: news@argosy.UUCP Reply-To: kentb@shark.UUCP (Kent Beck) Organization: MasPar Computer Corp, Sunnyvale CA Lines: 17 Peter Kriens says "Instance variables have a natural tendenncy (sic) to contain the most relevant information regarding an object. So it seems quite natural to me that they should be accessible outside the object." My point on accessing methods is that objects are much more about behavior than about structure. Thinking about any message send as an instance variable accessing method allows assumptions about the structure of one object to leak into others. In a perfectly disciplined world this wouldn't happen, but realistically I have seen too many cases of "highlighted: aBoolean" methods to tell beginners anything but "don't create accessing methods unless you absolutely need them, and even then think about what behavior the object might be able to offer to eliminate the need to disclose structure". The answer may be that the object cannot deliver the needed functionality itself and so it has to allow itself to be plundered from the outside, but access methods are not near the top of coding strategies. Kent