From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c83a22003c320b45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-16 18:15:05 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!news.duke.edu!news.mathworks.com!udel!gatech!swrinde!ihnp4.ucsd.edu!network.ucsd.edu!mbk From: mbk@inls1.ucsd.edu (Matt Kennel) Newsgroups: comp.lang.ada Subject: Re: Initialization Params for Controlled Types Date: 16 Nov 1994 21:45:00 GMT Organization: Institute For Nonlinear Science, UCSD Distribution: world Message-ID: <3adugs$j90@network.ucsd.edu> References: <3a8k92$10rk@watnews1.watson.ibm.com> NNTP-Posting-Host: lyapunov.ucsd.edu X-Newsreader: TIN [version 1.1 PL8] Date: 1994-11-16T21:45:00+00:00 List-Id: Norman H. Cohen (ncohen@watson.ibm.com) wrote: : This is a more general problem that arises with OOP in any language: : Often the need arises to define a new class B that has MOST, BUT NOT ALL : of the features of some other class A. The problem is that the author of : A, not having been omnisicient, failed to recognize it as a special case : of a more general problem for which other special cases would arise in : the future. If you don't have the authority to modify the definition of : class A, you end up duplicating a lot of code. If you do have such : authority, you can FACTOR the common features of A and B into a new class : C, redefine A as a specialization of C, and define B as another : specialization of C. If you separate subtyping from implementation inheritance there is no problem doing what you want. In B, you inherit just some of the implementation of A. This is not a problem because by doing so you do not promise to uphold B as a subtype of A. You then write an abstract class "C" that fits over A and B (with no implementation) that abstracts the commonality. A and B are both subtypes of C, but neither is a subtype of each other. : -- : Norman H. Cohen ncohen@watson.ibm.com -- -Matt Kennel mbk@inls1.ucsd.edu -Institute for Nonlinear Science, University of California, San Diego -*** AD: Archive for nonlinear dynamics papers & programs: FTP to -*** lyapunov.ucsd.edu, username "anonymous".