comp.lang.ada
 help / color / mirror / Atom feed
From: danmcleran@hotmail.com
Subject: Re: Private area and child packages
Date: 31 Dec 2004 19:45:52 -0800
Date: 2004-12-31T19:45:52-08:00	[thread overview]
Message-ID: <1104551152.044769.314670@z14g2000cwz.googlegroups.com> (raw)
In-Reply-To: <wp6dnZRo_NWE00ncRVn-3A@comcast.com>


tmoran@acm.org wrote:
>    You could burn the only copy of the source code.  Seriously, how
> else could you enforce such a restriction on future developers who
> want to fiddle with/fix your code?

Isn't that what abstraction and encapsulation is all about? In your
designs, do you make eveything public because it can be done that way
by some future developer anyway?

> Even if the compiler would
> allow such a limit (say by disallowing child packages) what would
> prevent someone from simply modifying your code, say by moving the
> "hidden" declaration from the private to the public part of the spec?

If you take this argument to its logical extreme, then all of the time
and effort that has gone into creating programming languages to provide
features such as abstraction & encapsulation has been a giant waste of
time. Since anyone could always make private data public any time they
choose, why not just stick with assembly language(s) or C? Why not just
make everything public all of the time?

> Or, if they can't modify your code, but can find a copy of the source
> somewhere, they could declare their own structure to match yours, and
> use an address clause to overlay their (visible) structure over
yours.

This seems like a pretty far-fetched counter-argument.

>   Part of the Ada Style is a certain humility.  Assuming that your
> code and your design is so perfect that any change by anyone in the
> future is bad, is unwise, as shown by much sad experience.  IMHO

I would agree, but I would also argue that it is in the best interests
of a good software design to only expose what is absolutely necessary
to be exposed.




  reply	other threads:[~2005-01-01  3:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-29  4:05 Private area and child packages danmcleran
2004-12-29  4:47 ` tmoran
2004-12-29 15:10   ` danmcleran
2004-12-30 18:51     ` tmoran
2005-01-01  3:45       ` danmcleran [this message]
2004-12-29  4:49 ` Jeffrey Carter
2004-12-29 15:27   ` danmcleran
2004-12-29 16:53     ` Samuel Tardieu
2004-12-30  4:07       ` Jeffrey Carter
2004-12-30 15:31   ` danmcleran
2004-12-30 18:14     ` Jeffrey Carter
2004-12-31 17:55   ` danmcleran
     [not found]   ` <1104515735.052116.248180@c13g2000cwb.googlegroups.com>
2004-12-31 19:02     ` Jeffrey Carter
2004-12-29 19:05 ` Martin Krischik
2004-12-29 21:44 ` Stephen Leake
replies disabled

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