Path: utzoo!utgpu!attcan!uunet!tektronix!tekcrl!tekchips!soiffer From: soiffer@tekchips.CRL.TEK.COM (Neil Soiffer) Newsgroups: comp.lang.smalltalk Subject: Re: Message dispatch on argument class Message-ID: <3261@tekcrl.CRL.TEK.COM> Date: 10 Nov 88 19:47:25 GMT References: Sender: ftp@tekcrl.CRL.TEK.COM Reply-To: soiffer@tekchips.CRL.TEK.COM (Neil Soiffer) Organization: Tektronix, Inc., Beaverton, OR. Lines: 15 As mentioned earlier, multiple polymorphism was discussed in Ingalls' paper in OOPSLA '86. What hasn't been mentioned is why this is better than a "typecase". The reason is modularity and reuse. If a new type is added and typecase is used, it is likely that old code must be modified (ie, a new clause added to typecases). If multiple dispatch is used, then no old code needs to be modified, only new code added to handle the new type. In Smalltalk's number code, "isKindOf" and "isMemberOf" are used in a modular way -- they only test the current type and if a match is not found, then the message is "resent" to a more generic handler. Neil Soiffer PS to Kent Beck: I grew you a few nits to harvest in this message.