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,aea4cc77526f5e4a X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr11.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada 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> Subject: Re: Separate Compilation in Programming Languages X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Message-ID: <%Ntwj.12620$Ch6.11402@newssvr11.news.prodigy.net> NNTP-Posting-Host: 70.134.112.39 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr11.news.prodigy.net 1203923195 ST000 70.134.112.39 (Mon, 25 Feb 2008 02:06:35 EST) NNTP-Posting-Date: Mon, 25 Feb 2008 02:06:35 EST Organization: SBC http://yahoo.sbc.com X-UserInfo1: TSU[@I_A\S@QBTLYYZH@^SXBUSXB@DTMNHWB_EYLJZ]BGIELCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM Date: Mon, 25 Feb 2008 07:06:35 GMT Xref: g2news1.google.com comp.lang.ada:20048 Date: 2008-02-25T07:06:35+00:00 List-Id: "Ray Blaak" wrote in message news:uy799dama.fsf@STRIPCAPStelus.net... > writes: > >> An implementation of an Interface (in Java) is still tightly bound to >> its specification, and any change of that implementation will carry forward. > > But of course. And that is exactly analogous a change to an Ada package spec > impacting the package body. > >> It is true that the Interface specification remains unchanged, and that is a >> good thing. However, if any part of the Interface specification changes, >> every other unit dependent on that specification will also have to be >> recompiled. > > Again, exactly the same as changing an Ada package spec. > Only when dependencies are at the specification level. 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. >> In the Ada model, where I defer the dependency on that >> Interface to the body of the dependent package, I need not recompile the >> specification of the dependent package. Rather, I can compile only the >> body, leaving the rest of my architecture intact. > > Recompiling a file does not imply the need to imply client files if the > public signatures have not changed. Most IDEs can handle this. > Exactly my point. If the public signatures do not change, there is no need for recompilation. When the public signature does change, the entire dependent architecture goes out of phase. If, however, that public signature change is isolated to the the implementation files, the separately compiled package body (as it is in Ada) the architecture remains intact. In Java, all public signatures, including implementations, are dependent on parent public signatures. There is no way to separate them. When one changes, everything dependent on that one change is also changed. In Ada, we move the dependency to the pacakge body so changes to a specification has no effect on the Ada specification, thereby preserving architectural integrity. This is not possible, as nearly as I can tell from all the examples given to me so far, in Java. > Also, recompiling an implementation class will not cause a recompilation of > the interface clients at all, since they do not even (necessarily) see the > implemetation in the first place. > > Again, exactly analogous to an Ada package body needing to be > recompiled. Ada's separation of spec and body is what allows you to do this. A > Java interface and its implementation class is an analogous separation. > >> I'm not sure why this is such a difficult idea. It is probably because I am >> not expressing it with sufficient skill. > > Well, as politely as possible, I submit that it is not about the skill, but > that I think you are mistaken. > Perhaps. But I still don't see how one can defer the dependency of a Java signature to the implementation of the Java class and prevent the need for recompiling the entire architecture when the signature of a parent class changes. The ripple effect through the entire chain of dependencies when one of those signatures changes is almost certain to be affected by such a change of signature. If Java can somehow accomodate that change automatically, it must be some kind of magic that is not immediately apparent, even to the Java developers I know. Richard Riehle