Xref: utzoo comp.lang.c++:3349 comp.lang.eiffel:194 comp.lang.smalltalk:1082 Path: utzoo!attcan!uunet!tektronix!sequent!mntgfx!plogan From: plogan@mntgfx.mentor.com (Patrick Logan) Newsgroups: comp.lang.c++,comp.lang.eiffel,comp.lang.smalltalk Subject: Re: Use of inheritance for classification? Message-ID: <1989May16.112934.14250@mntgfx.mentor.com> Date: 16 May 89 18:29:32 GMT References: <30582@apple.Apple.COM> Organization: Mentor Graphics Corporation, Beaverton Oregon Lines: 38 In-reply-to: kmcentee@Apple.COM's message of 12 May 89 23:16:07 GMT In article <30582@apple.Apple.COM> kmcentee@Apple.COM (Kevin McEntee) asks: =? Can code sharing outside of the natural taxonomy of the problem =? space happen gracefully? Here are some thoughts, written humbly as a would-be OO programmer not as an expert sage. (Just in case it comes across that way.) Perhaps in "Object Oriented Programming" there is no difference between code sharing and classes sharing a common class. In languages that are nearly "pure" OOLs (e.g. Smalltalk, Eiffel) it seems there is no way to share code without specifying the sharing as a common super class. Is there a reason to share code some other way? In hybrid OOLs such as CLOS and C++ it's possible to revert to creating good old procedures. What would be a reasonable situation to do so? I usually think of doing so in order to create a local procedure as a part of implementing a particular method. Or to be shared between methods of a particular class. If I was sharing a procedure in methods of disparate classes I would probably look for a missing link in the class taxonomy. Also, there's an article* that suggests an "algorithm" should in some cases be considered an object, e.g. FFTs. So one could create a class for a particular procedure or group of procedures that may not usually be considered objects. These would probably be few and far between. * "Using Types and Inheritance in Object Oriented Programming", Halbert, Daniel C. and Patrick O'Brien, (both at DEC) IEEE Software, Sept. 1987 -- Patrick Logan | ...!{decwrl,sequent,tessi}!mntgfx!plogan Mentor Graphics Corporation | plogan@pdx.MENTOR.COM Beaverton, Oregon | "My other computer is a Lisp machine."