Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!aero-c!gumby.dsd.trw.com!deneva!mongoose From: mongoose@spf.trw.com (Julian Watkins) Newsgroups: comp.lang.smalltalk Subject: Using methods in the superclass' superclass Message-ID: <28319BCD.B2F@deneva.sdd.trw.com> Date: 15 May 91 20:36:28 GMT Sender: news@deneva.sdd.trw.com Organization: TRW Data Systems Center, Redondo Beach, CA Lines: 30 Originator: mongoose@acrux I am porting some st80 code that was originally done by modifying Analyst Spreadsheet classes rather than by subclassing them. I am attempting to remedy this situation by creating subclasses that override only the methods that really need to be overridden. One problem I am getting is that I have to override methods that call methods in the superclass. This is easy to do by using the pseudo-variable "super". The problem is that I end up calling the method that exists in the immediate superclass (the one I just subclassed from) rather than ITS superclass. Maybe an example would suffice: Matrix variableSubclass: #SpreadsheetHolder SpreadsheetHolder variableSubclass: #MySpreadsheetHolder When I override a method from SpreadsheetHolder in MySpreadsheetHolder, I would like to access methods that really exist within Matrix. If I use "super" I get methods that are in SpreadsheetHolder. My current work around is to create methods in SpreadsheetHolder that do nothing but call the method in "super" that I need to use in MySpreadsheetHolder. My question is: Is this the only way to do what I want? Am I missing the boat somewhere? Should I try to restructure the class hierarchy so that there never is a case where this needs to happen? Direct E-mail is fine, unless this seems to be a topic that could use some open discussion. -- Julian J. Watkins 213-813-6516 watkins@spf.trw.com