comp.lang.ada
 help / color / mirror / Atom feed
From: Michael Erdmann <Michael.Erdmann@snafu.de>
Subject: Re: Usage of Interfaces with Ada 95
Date: Tue, 30 Sep 2003 21:58:10 +0200
Date: 2003-09-30T21:58:10+02:00	[thread overview]
Message-ID: <ir3p41-7da.ln1@boavista.snafu.de> (raw)
In-Reply-To: uoex25ude.fsf@earthlink.net

Matthew Heaney wrote:


>> 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?
> 
> The Generic_Algorithm contains some kind of implementation of an
> algorithm, not an iterator.  The algorithm uses the iterator to
> implement the algorithm.
> 
> 
>>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.
> 
> Yes, the generic algorithm specifies what it requires of the iterator.
> Any iterator satisfying those (logical) properties can be used, as we
> saw in the example.
> 
> 
>> 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.
> 
> Well, that's not static polymorphism.  It's dynamic polymorphism -- or
> at least it's type derivation.
> 
> I much don't like inheritance, but you seem prefer it.  Vive la
> difference, comme on dit en France (et aux Etats Unis, aussi).

I am not so mutch in inheritance, static/non static polymorphism etc... 
The idea originated some time ago. Normally in my open source projects i 
split up the source code into the following parts (by subdirectories):

./src    - All sources of the basic functionality of the project
./util   - A place to put all utility packages but does not on the project
./apps   - All application drivers for the project

I have made the experience this is theoretical quite simple to move the 
utility package between projects but what is causing useless effort is 
the evolution of basics concepts. When i complete one projects and find 
in the next project some kind of bug it is normally difficult to find 
out how this component fits into the old context since my understanding
of the properties of a certain concept (e.g. Iterator) has changed 
since then.
Therefor i like to standarize coding to this extend that at least basic 
concepts are standarized by introducing a directory 

./intf 

which contains abstract interfaces defining such basic concepts. The idea
to put there so called non functional interfaces which means zero code.

If i have to extend/change a component when porting it between projects, let 
the compiler find out what has changed since i am compiling the code 
against the interfaces of the old project. I thought that abstract 
types would be best choice :-/
On the second hand i intended to achive a consistent look and feel over all 
projects. The idea is not to achieve some kind of "wold best code" but 
simply to reduce my efforts and make maintenace cheeper.

I guess static polymorphism a one way of doing it. The charme about it 
is that you already break down the interfaces into some generic 
procedure implementation, which documents by it self what the concept 
is intended to do.
In my original idea, this was not the case since i wanted to  write down 
an interface specification where you need to document the semantics of 
this interface explicitly, which naturaly poses the problem the 
actual implementation my deviate completly from the deocumentation 
resulting in strange behaviours and the compiler does not has any chance
to help you.

I will give it a trail.


Regards
   M.Erdmann













  reply	other threads:[~2003-09-30 19:58 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
2003-09-30 10:02               ` Mário Amado Alves
2003-09-30 12:31               ` Matthew Heaney
2003-09-30 19:58                 ` Michael Erdmann [this message]
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