comp.lang.ada
 help / color / mirror / Atom feed
From: mockturtle <framefritti@gmail.com>
Subject: Re: What is the difference of "with null record" and "with private"?
Date: Fri, 23 May 2014 11:55:09 -0700 (PDT)
Date: 2014-05-23T11:55:09-07:00	[thread overview]
Message-ID: <29a09fe5-72c0-40e0-bf72-632c4a13232e@googlegroups.com> (raw)
In-Reply-To: <llo3iu$mqp$2@speranza.aioe.org>

On Friday, May 23, 2014 8:21:21 PM UTC+2, Victor Porton wrote:
> Victor Porton wrote:
> 
> 
> 
> > What is the difference of "with null record" and "with private"?
> > 
> > Both denote a descendant of a type with no new additional public fields.
> > I see no difference. What is the difference and when one or another should
> > be used?
> 
> Clarification of my question: I mean the case when the full view of the type 
> is "with null record".
> 

Well, as I see it, it is more a matter of visibility.  It is true that in both cases you have the same "structure" (namely, the ancestor with no new fields), but in the case of "with private" the "users" (that is, the packages that use the derived type) do not know that...

One could say that "with private" is used to hide the internal details of your type and that if the extension is done with a "null record" there is not much to hide. Actually, I cannot imagine a case where the fact that it is public that the extension is null can cause loss of maintainability the day some new fields are added.  Nevertheless, usually I prefer the "with private" form for uniformity.

Riccardo

  reply	other threads:[~2014-05-23 18:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 18:19 What is the difference of "with null record" and "with private"? Victor Porton
2014-05-23 18:21 ` Victor Porton
2014-05-23 18:55   ` mockturtle [this message]
2014-05-23 19:42     ` Adam Beneschan
2014-05-23 22:05       ` Adam Beneschan
2014-05-24  8:19       ` mockturtle
2014-05-23 20:45     ` Georg Bauhaus
2014-05-23 18:59 ` Dan'l Miller
2014-05-23 21:45 ` Shark8
2014-05-24 10:49   ` Victor Porton
2014-05-24 17:33     ` Shark8
2014-05-23 21:55 ` Randy Brukardt
replies disabled

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