Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!mips!apple!susser From: susser@Apple.COM (Joshua Susser) Newsgroups: comp.lang.smalltalk Subject: Re: Using methods in the superclass' superclass Message-ID: <53313@apple.Apple.COM> Date: 24 May 91 20:49:14 GMT References: <28319BCD.B2F@deneva.sdd.trw.com> Organization: Apple Computer Inc. (ATG) Lines: 33 In article <28319BCD.B2F@deneva.sdd.trw.com> mongoose@spf.trw.com (Julian Watkins) writes: > I am porting some st80 code that was originally done by modifying Analyst > Spreadsheet classes rather than by subclassing them. [...discussion of problem omitted...] Class Object has a number of messages that are overridden, that you still want to be able to get to directly. "new" is a good example of this. The provision for allowing direct access to the functionality of new without mucking about in the methods implemented in the intermediate ancestors was to create a "basicNew" method that does the same thing. So even though "new" is overridden, you can still always get to "basicNew". So if you have a message "spam" in Matrix, move the body of the method to "basicSpam", and change "spam" to just do "^self basicSpam". Then your subclass can say "super basicSpam" anywhere it needs to bypass the code in SpreadsheetHolder. By the way, what *are* you doing that needs to get directly to methods in Matrix? I seem to remember the only behavior SpreadsheetHolder inherits from Matrix is the various atXXX: and atXXX:put: accesing methods. I guess I should have made SpreadheetHolder be a subclass of Object with a Matrix in an instance variable, and then you wouldn't have to muck about with all this bypassing and disinheritance. Sorry, but I had only been programming in Smalltalk a few weeks when I started the design. But next time I'll know... Joshua Susser, Object Percussionist Apple Computer, Advanced Technology Group inet: susser@apple.com | link: susser.j | phone: 408/974-6997 Macintosh Jr. - The power to crush the other kids.