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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6b6619eb9cada212 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Help me to chose between ADA 95 and C++ Date: 1999/12/14 Message-ID: <3856cb06_2@news1.prserv.net>#1/1 X-Deja-AN: 560728957 Content-transfer-encoding: 7bit References: <01bf37fb$a91afb60$0564a8c0@IS-D2D04C.test> <829rbv$a8m$1@nntp6.atl.mindspring.net> <01bf3e32$0b9dc880$022a6282@dieppe> <385112AE.7E2CFA9@rdel.co.uk> <3855e3cd_1@news1.prserv.net> <38561A6C.5DE3D901@rdel.co.uk> <38567806.FD1F4232@averstar.com> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 14 Dec 1999 22:56:06 GMT, 129.37.62.81 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-14T00:00:00+00:00 List-Id: In article <38567806.FD1F4232@averstar.com> , Tucker Taft 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. 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;