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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c5168ea14aa45fce X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.98.102 with SMTP id eh6mr1605139wib.7.1359683133491; Thu, 31 Jan 2013 17:45:33 -0800 (PST) Path: bp2ni9273wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newspeer1.nac.net!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!news.snarked.org!feeder.erje.net!eu.feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005+ interface example Date: Sun, 27 Jan 2013 17:54:38 +0100 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: cDN0fd8KlIeJLyErIrSf0A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-01-27T17:54:38+01:00 List-Id: On Sun, 27 Jan 2013 06:08:31 -0800 (PST), gautier_niouzes@hotmail.com wrote: > Does someone have an example of Ada 2005 interface type ? You might find interfaces actively used in the AICWL, e.g. http://www.dmitry-kazakov.de/ada/aicwl.htm#2.5 A layer of the widget usually implements several interfaces. For example: type Elliptic_Scale_Layer (<>) is new Abstract_Bordered_Layer and Scalable_Layer and Widened_Layer with private; > Just to see how it works in practice. It works just fine, except the cases when full MI is required. Then it becomes quite messy because the only way to provide implementations is through generics. Another case for interfaces in Ada 2005 is smart pointers. I don't know how well the newly introduced by Ada 2012 dereferencing works. But in Ada 2005 you would use an interface to describe both the target type and the controlled pointer. type Thing is limited interface; ... -- operations on thing type Handle is ... and Thing ...; ... -- implements operations by delegation to the target private type Implementation is ... and Thing ...; ... -- implements operations -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de