comp.lang.ada
 help / color / mirror / Atom feed
From: Michael Erdmann <Michael.Erdmann@snafu.de>
Subject: Re: Usage of Interfaces with Ada 95
Date: Sat, 27 Sep 2003 17:05:14 +0200
Date: 2003-09-27T17:05:14+02:00	[thread overview]
Message-ID: <bilg41-cb.ln1@boavista.snafu.de> (raw)
In-Reply-To: 1064608631.639035@master.nyc.kbcfp.com

Hyman Rosen wrote:

> Michael Erdmann wrote:
>> The point is that in java i am able to provide an interface
>> which is called IIterator and use this interface in different
>> implementation, but it is the same interface which has to be
>> understood by the programmer only once!
> 
> No; what does your iterator return when you ask for the
> next element? An Object, I presume. Then the client must
> cast it to the type he thinks it is. That's a terrible
> interface, and certainly not worth copying.

This is exactly what happens in a lot of java code i have 
seem. They are using somthing like

    if(  x.istanceOf(...) ) {
    }

I feel the same way, this is a stupid aproach which also
leads to stability problems when something changes in the 
environment and new types are introduced.

The consequence is, that i have to stick with the somewhat 
complicated process:

  1. Define a concept as a generic, eg.

     generic
        type aType ....;

     package ... is 

        type Object is abstract ...

        funtion Get(This : Object) return aType is abstract; 
        .. other methods defining the concept
    end package;

  2. Provide a specific application of the concept to a 
     data type to avoid the cast issue.
     (lets call this an specefic interface)

  3. Use the specific interface within an application.

Maybe i need drop my original idea completley. The idea was to 
provide a set of interfaces which are allowing to develop
software based on concepts (patterns). The Enumeration is 
such a concept beside of a lot of other patterns.
My hope was/is to simplyfy code by using standard patterns.


Regards
   M.Erdmann







  reply	other threads:[~2003-09-27 15:05 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 [this message]
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
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