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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,aea4cc77526f5e4a X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Separate Compilation in Programming Languages Date: Tue, 26 Feb 2008 12:42:18 +0100 Message-ID: <62ic8uF230f4oU1@mid.individual.net> References: <7xJvj.7420$Ru4.4246@newssvr19.news.prodigy.net> <5b9wj.4639$Mh2.1432@nlpi069.nbdc.sbc.com> <5Ekwj.10401$0o7.6822@newssvr13.news.prodigy.net> <%Ntwj.12620$Ch6.11402@newssvr11.news.prodigy.net> Reply-To: alejandro@mosteo.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net QZzhzdfoWh6C3hmW4Qg99Am6F4q2DTYiLKyevwuyUJWwdIxxw= Cancel-Lock: sha1:suTLjxEyIeLL/cg38Fgl6yyuf9U= User-Agent: Thunderbird 2.0.0.6 (X11/20071022) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:20081 Date: 2008-02-26T12:42:18+01:00 List-Id: Ray Blaak wrote: > writes: >> But, in Ada we can defer the dependency to the package body. In Java you >> cannot defer that dependency. A dependent unit, when the specification >> changes is combined with its implementation. Therefore, every dependent >> specification must also be compiled. As noted below, we can defer the >> dependency in Ada to the package body. There is nothing analogous to this >> in Java. > > This is simply false. > > I am starting to think that *I* don't have the sufficient communication > skills. There is a fundamental disconnect here. > > Consider this Ada situation: > > Client C ------> Package P spec > | > | > P body > > When P's spec changes, both C and P's body need to be recompiled. > > When only P's body changes, C is unaffected. > > Consider this Java situation: > > Client C ------> interface P_Spec > | > | > class P_Body implements P > > When P_Spec changes, both C and P_Body need to be recompiled. > > When only P_Body changes, C is unaffected, P_Spec is unaffected. > > I don't know how else to say it more clearly. > > Note that if anyone is referring to P_Body then they will be affected, but the > idea is that one takes the care so the clients only use P_Spec. This takes > effort and discipline, making things less convenient than Ada, but the ability > to have the separation is there in the Java language. I'd go farther and say that proper OO programming practice stresses the fact that clients must operate on interfaces, and not on particular implementation classes. Yes, it takes discipline, but it is what is expected. (Or what I would expect?) Still, having used both Java and Ada, I find true that Ada, by forcing always the separation, helps in "indoctrinating" this into programmers. Specifications in Ada are a blessing.