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-Thread: 103376,5af5c381381ac5a7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!drn From: Luis Espinal Newsgroups: comp.lang.ada Subject: Re: Ada requires too much typing! Date: 5 Jun 2010 12:58:51 -0700 Organization: NewsGuy - Unlimited Usenet $19.95 Message-ID: References: NNTP-Posting-Host: p77a40d2beaf319a029e11cb4ef7a4b3e9717f6035bd3e4fb.newsdawg.com User-Agent: Direct Read News 5.60 Xref: g2news1.google.com comp.lang.ada:11319 Date: 2010-06-05T12:58:51-07:00 List-Id: In article , Alex R. Mosteo says... > > >Hi Luis, thanks for the detailed reply. I understand your points clearly. > >My days of Java are a bit behind so I'm not sure what I'm about to say can >be done in Java. In Ada, one could extend an interface adding a new method >like this: > >procedure Moo (This : A) is null; > >And effectively it won't break any client, since it provides a default "no- >op" implementation. It won't work for functions, obviously. In any case, >clients would need to recompile, since in Ada land we're not talking of a >world of JVMs and dynamic hot-plugging, I presume. This alone (the use of >stand-alone executables) may make the problem much less of an issue. > >Also, not needing to specify defaults to overload a method could be of help? > >procedure Foo (This : A) is abstract; -- Added in 1st spec > >procedure Foo (This : A; Bar : A'Class) is null; -- Added in 2nd spec > >I've done sometimes the thing of having a insulating base class providing >some/most of the interface core functionality, but at the same time I >realized that this defeats to some degree the point of interfaces, since you >can't inherit from two such base classes. > >In any case I feel your pain about the lot of Java programmers and >frameworks ;-) I guess it has its goods and its bads. > >Alex. > That actually seems like a much better implementation of interfaces than Java's. I think it would have been interesting if Ada interfaces were to provide a default behavior for function that throws an exception when called. In Java, we usually have to inherit functions off interfaces for which no appropriate behavior exist, and thus the usual convention (manually implemented mind you) is to add a throw UnsuportedOperationException() for those functions. That'd probably be appropriate for enterprise systems, but not for critical systems which is probably why it is not implemented in Ada. You are right to point out that in Ada things compile or do not. In Java we never really know who is going to dynamically load (or inherit) from artifacts of our making. - Luis.