From: Michael Erdmann <Michael.Erdmann@snafu.de>
Subject: Re: Usage of Interfaces with Ada 95
Date: Tue, 30 Sep 2003 06:57:24 +0200
Date: 2003-09-30T06:57:24+02:00 [thread overview]
Message-ID: <l2fn41-0j8.ln1@boavista.snafu.de> (raw)
In-Reply-To: uhe2wh97s.fsf@earthlink.net
Matthew Heaney wrote:
> Michael Erdmann <Michael.Erdmann@snafu.de> writes:
>
>> ........ I my example i like to provide a package
>> enumerator where the developer X can put in his data type, but the
>> gerneric package forces him to implement the interface for his data
>> type and nothing else. If the semantic of this interface is simple, it
>> will be mutch easier for somebody else to maintain the code written on
>> this concept.
>
> You still haven't groked the static polymorphism idea.
>
> If I have the following generic algorithm:
>
> generic
> type Iterator_Type is private;
> with function Succ (Iterator : Iterator_Type)
> return Iterator_Type is <>;
> with procedure Process (Iterator : Iterator_Type) is <>;
> with function "=" (L, R : Iterator_Type)
> return Boolean is <>;
> procedure Generic_Algorithm (First, Back : Iterator_Type);
>
> Then of course this is going to check how iterators are declared by
> independent developers -- as soon as he tries to instantiate the generic
> algorithm. Any iterator any developer builds must conform to this
> logical interface.
Thanks for your example!
I assume, that the procedure Generic_Algorithm is containing some kind
of implementation of an iterator based on the input parameters of the
generic?
You are right, this provides a standarized interface, but i guess the
procedure Generic_Algorithm contains some kind of implementation of an
iteration based on the methods specified in the input?
I think the is a different view on the topic by defining a functionality
of an interface, providing a generic implementation which defines the
interface for the programmer. This was exactly what i dont like to
do. I dont like to spent the effort of breaking down a concept into
a generic implementation. This is the reason why i like to use interfaces.
Regards
M.Erdmann
next prev parent reply other threads:[~2003-09-30 4:57 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-26 16:36 Usage of Interfaces with Ada 95 Michael Erdmann
2003-09-26 16:50 ` chris
2003-09-26 16:55 ` Hyman Rosen
2003-09-26 19:10 ` Michael Erdmann
2003-09-26 20:37 ` Hyman Rosen
2003-09-27 15:05 ` Michael Erdmann
2003-09-28 2:11 ` Matthew Heaney
2003-09-29 2:25 ` George Shapovalov
2003-09-28 2:14 ` Matthew Heaney
2003-09-28 8:28 ` Michael Erdmann
2003-09-28 14:33 ` Matthew Heaney
2003-09-28 15:09 ` Michael Erdmann
2003-09-28 21:50 ` Matthew Heaney
2003-09-30 4:57 ` Michael Erdmann [this message]
2003-09-30 10:02 ` Mário Amado Alves
2003-09-30 12:31 ` Matthew Heaney
2003-09-30 19:58 ` Michael Erdmann
2003-09-28 17:10 ` Simon Wright
2003-09-28 21:52 ` Matthew Heaney
2003-09-28 21:58 ` Matthew Heaney
2003-09-29 19:37 ` Georg Bauhaus
2003-09-29 19:45 ` Georg Bauhaus
2003-09-30 7:10 ` Preben Randhol
2003-09-29 20:11 ` Simon Wright
2003-09-29 22:56 ` Matthew Heaney
2003-09-30 14:53 ` Matthew Heaney
2003-09-30 16:13 ` Preben Randhol
2003-09-29 13:49 ` Matthew Heaney
2003-09-28 18:22 ` Robert I. Eachus
2003-09-29 3:02 ` Hyman Rosen
2003-09-30 3:11 ` Robert I. Eachus
2003-09-30 13:38 ` Hyman Rosen
2003-09-30 21:46 ` Robert I. Eachus
2003-09-30 22:10 ` Hyman Rosen
2003-10-01 2:30 ` Robert I. Eachus
2003-10-01 2:41 ` Robert I. Eachus
2003-10-01 13:21 ` Hyman Rosen
2003-10-01 17:01 ` Robert I. Eachus
2003-10-01 18:46 ` Matthew Heaney
2003-09-29 14:52 ` Stephen Leake
2003-09-29 23:00 ` Matthew Heaney
2003-09-30 12:49 ` Marin David Condic
2003-09-30 23:48 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox