Possible Ada deficiency?

danmcleran_at_hotmail.com
Date: 12/31/04


Date: 31 Dec 2004 10:15:13 -0800

I would like to know if anyone else thinks that the inability to hide
private information from child packages is a deficiency in Ada95. I am
discussing ways to do this on another thread, (See Private area and
child packages), but it seems wrong that one has to go through a bunch
of machinations to do something like this. Wouldn't a language
construct for this be advantageous?

In C++ and Java, no private data can be seen by child classes. I think
that Ada would benefit from extending its information hiding
capabilities by allowing a package writer to conceal type information
from child packages.

What if Ada had a keyword, I've chosen 'concealed' for the sake of
discussion, to indicate that the implementation of a type was not
visible to the outside world (including child packages). Something like
this:

--This is not Ada!

package Some_Package is
type Not_So_Secret_Type is private; -- Child packages can see the
details
type Super_Secret_Type is concealed; -- Hidden from everyone
private
--child packages have full visibility
concealed
--not even child packages can see here
end Some_Package;



Relevant Pages

  • Re: Possible Ada deficiency?
    ... > private information from child packages is a deficiency in Ada95. ... > discussing ways to do this on another thread, (See Private area and ... Ada is just more honest about it. ...
    (comp.lang.ada)
  • Re: What is derived?
    ... Remember that private work on child packages and not on child classes. ... A child class declared in an unrelated package can not see the private part ...
    (comp.lang.ada)
  • Re: Possible Ada deficiency?
    ... >> #define private public ... I am surprised that child packages have as much visibility as ... package Parent ... Martin ...
    (comp.lang.ada)
  • Re: Possible Ada deficiency?
    ... I'm not trying to promote C++'s private. ... type's internal representation from child packages. ... If my type consists of a record, which contains stuff I don't want ...
    (comp.lang.ada)
  • Possible Ada deficiency?
    ... private information from child packages is a deficiency in Ada95. ... that Ada would benefit from extending its information hiding ...
    (comp.lang.ada)