From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Help me to chose between ADA 95 and C++
Date: 1999/12/14
Date: 1999-12-14T00:00:00+00:00 [thread overview]
Message-ID: <3856cb06_2@news1.prserv.net> (raw)
In-Reply-To: 38567806.FD1F4232@averstar.com
In article <38567806.FD1F4232@averstar.com> , Tucker Taft
<stt@averstar.com> wrote:
> You also can't implement an interface in multiple ways with a single type,
> which could be useful for things like the "observer" pattern where a single
> object wants to observe multiple other objects.
There's an example of how to do this in the design patterns archive.
<http://www.acm.org/archives/patterns.html>
Use the search engine to search for "observering multiple subjects" or
something like that.
In my little example, a digital clock observes, simultaneously, both a
battery (to indicate when the power is low) and a timer (its source of
time). Like this:
package Digital_Clocks is
type Digital_Clock
(Battery : access Battery_Type;
Timer : access Timer_Type) is limited private;
private
type Battery_Observer
(Clock : access Digital_Clock) is
new Observer with null record;
type Timer_Observer
(Clock : access Digital_Clock) is
new Observer with null record;
type Digital_Clock
(Battery : access Battery_Type;
Timer : access Timer_Type) is
new Limited_Controlled with record
Battery_Obs : Battery_Observer (Digital_Clock'Access);
Timer_Obs : Timer_Observer (Digital_Clock'Access);
end record;
...
end Digital_Clocks;
next prev parent reply other threads:[~1999-12-14 0:00 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-26 0:00 Help me to chose between ADA 95 and C++ Robert
1999-11-26 0:00 ` Harald Schmidt
1999-11-26 0:00 ` Andreas Winckler
1999-11-26 0:00 ` Florian Weimer
1999-12-04 0:00 ` Richard D Riehle
[not found] ` <01bf3e32$0b9dc880$022a6282@dieppe>
1999-12-10 0:00 ` Chris Powell
1999-12-13 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Ray Blaak
1999-12-14 0:00 ` Larry Kilgallen
1999-12-15 0:00 ` Robert A Duff
2000-01-12 0:00 ` Richard Pinkall-Pollei
1999-12-14 0:00 ` Simon Wright
1999-12-15 0:00 ` Chris Powell
1999-12-15 0:00 ` Robert A Duff
1999-12-15 0:00 ` Ted Dennison
1999-12-20 0:00 ` Stefan Skoglund
1999-12-16 0:00 ` Pascal Obry
1999-12-16 0:00 ` Aidan Skinner
1999-12-16 0:00 ` Lutz Donnerhacke
1999-12-16 0:00 ` Rakesh Malhotra
1999-12-21 0:00 ` Geoff Bull
1999-12-21 0:00 ` Robert Dewar
1999-12-21 0:00 ` Chris Powell
1999-12-21 0:00 ` Ted Dennison
1999-12-21 0:00 ` Robert Dewar
1999-12-13 0:00 ` DuckE
1999-12-14 0:00 ` Matthew Heaney
1999-12-13 0:00 ` Marin D. Condic
1999-12-13 0:00 ` Brian Rogoff
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Preben Randhol
1999-12-14 0:00 ` Stephen Leake
1999-12-14 0:00 ` Tucker Taft
1999-12-15 0:00 ` Stephen Leake
1999-12-15 0:00 ` Preben Randhol
1999-12-14 0:00 ` Brian Rogoff
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-21 0:00 ` Geoff Bull
1999-12-21 0:00 ` Tucker Taft
1999-12-22 0:00 ` Ted Dennison
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Stephen Leake
1999-12-23 0:00 ` Chris Powell
1999-12-14 0:00 ` Tucker Taft
1999-12-14 0:00 ` Matthew Heaney [this message]
1999-12-23 0:00 ` Chris Powell
1999-12-27 0:00 ` Robert A Duff
1999-12-14 0:00 ` Matthew Heaney
1999-12-15 0:00 ` Hyman Rosen
1999-11-26 0:00 ` Andreas Winckler
1999-11-26 0:00 ` Preben Randhol
1999-11-26 0:00 ` Preben Randhol
1999-11-27 0:00 ` Lionel Draghi
-- strict thread matches above, loose matches on Subject: below --
1999-12-14 0:00 Robert C. Leif, Ph.D.
1999-12-15 0:00 ` Richard D Riehle
1999-12-15 0:00 Robert C. Leif, Ph.D.
1999-12-16 0:00 ` Richard D Riehle
1999-12-16 0:00 ` Matthew Heaney
1999-12-17 0:00 ` Richard D Riehle
1999-12-18 0:00 ` Matthew Heaney
1999-12-20 0:00 ` Richard D Riehle
1999-12-22 0:00 Help me to chose between ADA 95 and C++ ( Ehud Lamm
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox