comp.lang.ada
 help / color / mirror / Atom feed
From: jgoodsen@treasure.radsoft.com (John Goodsen)
Subject: Re: Ada 90 inheritance request?
Date: 19 Dec 1994 18:58:59 GMT
Date: 1994-12-19T18:58:59+00:00	[thread overview]
Message-ID: <JGOODSEN.94Dec19135859@treasure.radsoft.com> (raw)
In-Reply-To: eachus@spectre.mitre.org's message of 15 Dec 94 18:41:24

In article <EACHUS.94Dec15184124@spectre.mitre.org> 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



  reply	other threads:[~1994-12-19 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-23 21:33 Ada 90 inheritance request? S M Ryan
1994-12-02 16:46 ` Tucker Taft
1994-12-09 17:26   ` Cyrille Comar
1994-12-11 18:47     ` Bob Duff
1994-12-12  3:15     ` Tucker Taft
1994-12-13 19:02     ` John Goodsen
1994-12-14 19:49       ` John Goodsen
1994-12-15 18:41         ` Robert I. Eachus
1994-12-19 18:58           ` John Goodsen [this message]
1994-12-20 10:40             ` Robert I. Eachus
1994-12-21 16:02             ` Norman H. Cohen
1994-12-22  1:21             ` Bob Duff
1994-12-17 13:55       ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox