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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,309015504ed37ff0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-27 07:57:45 PST Path: news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.stueberl.de!eusc.inter.net!news.eusc.inter.net!boavista.snafu.de!news From: Michael Erdmann Newsgroups: comp.lang.ada Subject: Re: Usage of Interfaces with Ada 95 Date: Sat, 27 Sep 2003 17:05:14 +0200 Organization: gnade.sourceforge.net Message-ID: References: <1064595326.831730@master.nyc.kbcfp.com> <1064608631.639035@master.nyc.kbcfp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.eusc.inter.net 1064674664 4202 213.73.71.149 (27 Sep 2003 14:57:44 GMT) X-Complaints-To: abuse@eusc.inter.net User-Agent: KNode/0.7.1 Xref: news1.google.com comp.lang.ada:33 Date: 2003-09-27T17:05:14+02:00 List-Id: 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