comp.lang.ada
 help / color / mirror / Atom feed
From: "Frank J. Lhota" <NOSPAM.FrankLho@rcn.com>
Subject: Re: Hiding a type
Date: Sat, 6 Jul 2002 18:52:31 -0400
Date: 2002-07-06T22:52:39+00:00	[thread overview]
Message-ID: <ag7sbn$db9$1@bob.news.rcn.net> (raw)
In-Reply-To: 3D2733F4.8010304@hotmail.com

> I don't want to expose the name Private_Type_Ptr because I know that it
> might change in the future.  I know it sounds silly so it's probably
> just poor planning on my part.

It doesn't sound silly, it is always a good idea to hide implementation
details. On the other hand, Private_Type_Ptr as declared in your code
snippet is not exposed, since it appears in the private portion of the Test
package. The only units exposed to the private part of Test is the
cooresponding package body, and any child package of Test. The clients of
Test will not see this definition.

My recommendation would be to skip the definition of Private_Type_Ptr
entirely, and define Public_Name as the access type:

package Test is
     type Public_Name is limited private;
     function Initialize( File_Name : String ) return Public_Name;
     procedure Process( Input : Public_Name );
private
     type Private_Type is record ... end record;
     type Public_Name is access all Private_Type;
end Test;






  parent reply	other threads:[~2002-07-06 22:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-06 17:17 Hiding a type Ryan Tarpine
2002-07-06 21:30 ` Pat Rogers
2002-07-06 18:16   ` Ryan Tarpine
2002-07-06 22:49     ` sk
2002-07-06 22:52     ` Frank J. Lhota [this message]
2002-07-06 20:38       ` Ryan Tarpine
2002-07-07 10:31         ` Frank J. Lhota
2002-07-07 11:20       ` Simon Wright
2002-07-07 13:58         ` Frank J. Lhota
2002-07-07 22:24           ` Ryan Tarpine
2002-07-07 17:15         ` Jeffrey Carter
2002-07-07 17:58           ` Simon Wright
2002-07-06 23:10     ` chris.danx
2002-07-06 20:21       ` Ryan Tarpine
2002-07-07  1:58         ` Jeffrey Carter
2002-07-08  7:20         ` Preben Randhol
2002-07-06 23:12       ` chris.danx
replies disabled

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