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,be30d7bb9651853b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-20 10:36:23 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!swiss.ans.net!cmcl2!jpmorgan.com!jpmorgan.com!usenet From: jgoodsen@treasure.radsoft.com (John Goodsen) Newsgroups: comp.lang.ada Subject: Re: Ada 90 inheritance request? Date: 19 Dec 1994 18:58:59 GMT Organization: The Dalmatian Group, Inc. Message-ID: References: <3ca3vl$n14@lang8.cs.nyu.edu> NNTP-Posting-Host: treasure.ny.jpmorgan.com In-reply-to: eachus@spectre.mitre.org's message of 15 Dec 94 18:41:24 Date: 1994-12-19T18:58:59+00:00 List-Id: In article eachus@spectre.mitre.org (Robert I. Eachus) writes: Never being afraid to jump into the fray, I'll respond to John by taking his MI example and asking why the obvious Ada 95 version is not acceptable: type Needs_Finalization is new Controlled with...; -- overriding of Initialize/Adjust/Finalize procedure Initialize (Obj : in out Needs_Finalization); procedure Adjust (Obj : in out Needs_Finalization); procedure Finalize (Obj : in out Needs_Finalization); type Ctrl_T is new T with record NF: Needs_Finalization; end record; Maybe it's just me not seeing something here (which could be an indicator of the usability issues involved with addressing MI in Ada95), but where is the polymorphic behavior in the MI lattice? Wouldn't the above solution require me to delegate methods to the NF member of Ctrl_T (by hand)? Now I can think of cases where this won't work, but they are precisely the cases where the "true" MI version won't work either. No, I take that back. There are cases where true MI will fail, and the Ada 95 version will sail through. For example, if someone modifies T so that it inherits directly from Controlled... In general where Ada 95 says "this is unsafe, so we will not allow it," most MI languages say "this is really neat, and if you are VERY careful, it will work, but never on large projects, because it doesn't scale well." I've been there, I've done that, I've seen the maintenance nightmares that can occur when more than one programmer depends on unsafe MI on the same project. This isn't clear to me. Can you give an example (besides the overused diamond inheritance pattern) ? What do you mean by "unsafe MI" ? thanks -- -- John Goodsen Currently on-site at: The Dalmatian Group JP Morgan User Interface Specialists 60 Wall St., New York City jgoodsen@radsoft.com jgoodsen@jpmorgan.com