comp.lang.ada
 help / color / mirror / Atom feed
From: <adaworks@sbcglobal.net>
Subject: Re: Separate Compilation in Programming Languages
Date: Tue, 26 Feb 2008 07:29:55 GMT
Date: 2008-02-26T07:29:55+00:00	[thread overview]
Message-ID: <TdPwj.12744$Ch6.10636@newssvr11.news.prodigy.net> (raw)
In-Reply-To: wccmyppg7yd.fsf@shell01.TheWorld.com


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wccmyppg7yd.fsf@shell01.TheWorld.com...
> <adaworks@sbcglobal.net> writes:
>
>> Yes.  I agree.  When we defer the implementation to the body, there is
>> no need to recompile anything, unless the implementation is tightly
>> bound to the specification.   The architectural concern is when we
>> recompile the specification.   Any change to the specification will
>> imply a change to everything dependent upon it.
>
> Right, but in Java, you can always move that dependence into an
> implementation of an interface, just like you can move that dependence
> down into a package body in Ada.
>
Even if this completely accurate, the vast majority of Java applications
use only a small number of packages that consist of interfaces.  The
rest of the design does not use the Interface model.   For those classes,
in those packages, the dependency problem is not only possible but,
after doing some additional research today, I find is fairly common.

>> In your example, you have deferred the dependency to the body of P2.
>> So there is no need to recompile the spec for P2. However, if the with
>> clause had been at the specification level of P2, and if the specification
>> for P1 had changed, there is certainly a danger of an architectural
>> problem if we did not recompile the specification and body for P2.
>
> Yes, the spec of P2 would need to be recompiled in that case.
> I don't see why that's an "architectural problem".
>
It is an architectural problem because, in Java, a corrupted dependency,
something that apparently actually occurs in large-scale Java designs,
is also going to corrupt the architecture of the software.  As noted in
a separate post, this problem has required the introduction of special
dependency management tools such as Ivy, Maven, and Ant -- and
these tools are not yet able to detect all the problems though they are
getting better.

Every software entity has an architecture, planned or ad hoc.  One of the
more important aspects of an architecture is to take every action possible
to reduce or manage dependencies between the artifacts of that
architecture.   The separate compilation model of Ada does that better
than most other languages.  Modula has some virtues in this respect.
However, the research I have been doing on Java leads me to believe
that the language has significant weaknesses in architectural stability
for large-scale systems.   There are quite a few articles on the Internet
describing these problems..
>
> Right.  But the point of my example is that you can always defer the
> "with" to an implementation of an interface.
>
Even if we allow for the benefit of the Interface in this situation, we have not
dealt with the larger body of a Java program that is not built using Interfaces.

>> In a separate reply, you mentioned generics.   In most cases, there is no
>> reason why a generic cannot be instantiated at the package body level.
>
> I don't agree with that.  In my experience, when I declare a type T,
> I often want a sequence-of-T, or mapping-of-T, or whatever, exposed to
> clients, that is done by generic instantiation.
>
But that does not have to be instantiated at the package spec level.  In many
cases, the instantiation is possible, and preferred at the body level.  Granted,
we sometimes have to instantiate at the spec level,  but not always.  Java
templates are usually instantiated at the specification level, and that most
certainly introduces a level of dependency with system-wide effects.

>> My contention is that the Ada model of dependency management is far
>> superior to most other models for the preservation of architectural
>> stability.   Am I alone in this view?
>
> I'm not entirely sure what you mean by "architectural stability" here,
> but I guess I'd agree if you changed "far superior" to "slightly more
> convenient". ;-)
>
Architectural stability implies that, except under extraordinary circumstances,
any change to some artifact of the architecture will have minimal impact on
the rest of that architecture.   This is one valuable property of Ada's ability
to let us defer most of our dependencies to the lowest level of the design
possible.  This is not a property of Java, C++, or most other languages
in current use today.  Even incremental compilation falls a little short. Oh,
and does Rational Apex  still support incremental compilation in Ada? GNAT
is not the only Ada environment around.

Richard Riehle





  reply	other threads:[~2008-02-26  7:29 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 17:35 Separate Compilation in Programming Languages adaworks
2008-02-22 17:52 ` Dirk Heinrichs
2008-02-23  0:23   ` adaworks
2008-02-22 18:10 ` Ray Blaak
2008-02-22 23:53   ` adaworks
2008-02-23  1:40     ` Ray Blaak
2008-02-23  7:29       ` adaworks
2008-02-23 18:42         ` Ray Blaak
2008-02-22 18:18 ` Niklas Holsti
2008-02-23  0:14   ` adaworks
2008-02-23  7:23     ` Niklas Holsti
2008-02-23  7:31       ` Niklas Holsti
2008-02-23 16:00         ` adaworks
2008-02-23 12:27     ` Georg Bauhaus
2008-02-23 12:37   ` Dirk Heinrichs
2008-02-23 13:03     ` Niklas Holsti
2008-02-22 19:11 ` Dmitry A. Kazakov
2008-02-23  0:16   ` adaworks
2008-02-22 19:33 ` Larry Kilgallen
2008-02-22 20:47 ` Simon Wright
2008-02-22 21:27 ` Robert A Duff
2008-02-23  0:12   ` adaworks
2008-02-23 10:28     ` framefritti
2008-02-23 12:45     ` Dirk Heinrichs
2008-02-23 15:16     ` Robert A Duff
2008-02-23 16:47       ` adaworks
2008-02-23 18:47         ` Ray Blaak
2008-02-24  7:40           ` adaworks
2008-02-24  9:42             ` Ray Blaak
2008-02-24 20:41               ` adaworks
2008-02-25  2:37                 ` Ray Blaak
2008-02-25  7:06                   ` adaworks
2008-02-25 13:12                     ` Robert A Duff
2008-02-25 17:44                     ` Ray Blaak
2008-02-25 22:16                       ` Ray Blaak
2008-02-26  5:10                         ` John W. Kennedy
2008-02-26 19:08                           ` Ray Blaak
2008-02-26  7:11                         ` adaworks
2008-02-26 13:38                           ` Stephen Leake
2008-02-26 14:56                             ` adaworks
2008-02-26 19:15                               ` Ray Blaak
2008-02-26 19:13                           ` Ray Blaak
2008-02-26 21:25                             ` Ray Blaak
2008-02-27  1:15                               ` Robert A Duff
2008-02-26  7:06                       ` adaworks
2008-02-26 11:42                       ` Alex R. Mosteo
2008-02-26 15:05                         ` adaworks
2008-02-26 15:15                           ` Alex R. Mosteo
2008-02-24 17:26             ` Robert A Duff
2008-02-23 20:46         ` Robert A Duff
2008-02-24  7:31           ` adaworks
2008-02-24 17:20             ` Robert A Duff
2008-02-24 20:33               ` adaworks
2008-02-25  1:07                 ` Robert A Duff
2008-02-26  7:29                   ` adaworks [this message]
2008-02-26 19:22                     ` Ray Blaak
2008-02-27  1:58                       ` adaworks
2008-02-27 20:34                         ` Ray Blaak
2008-02-27 22:31                           ` Robert A Duff
2008-02-27 23:35                             ` Ray Blaak
2008-02-28  0:19                               ` Randy Brukardt
2008-02-28  9:18                               ` Georg Bauhaus
2008-02-29  5:57                             ` adaworks
2008-02-29  6:04                               ` Ray Blaak
2008-02-29 10:48                                 ` Alex R. Mosteo
2008-02-29 17:05                                 ` adaworks
2008-02-29 18:33                                   ` Ray Blaak
2008-02-29  6:10                           ` adaworks
2008-02-22 22:16 ` Jeffrey R. Carter
2008-02-23 13:44 ` Brian Drummond
2008-02-23 17:19   ` adaworks
2008-02-25  7:53 ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox