comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Visibility issue
Date: Wed, 16 Sep 2020 17:05:03 +0200	[thread overview]
Message-ID: <rjt9is$dvo$1@gioia.aioe.org> (raw)
In-Reply-To: bce49fe6-b494-4f24-9cf5-a7b8be4c23d7n@googlegroups.com

On 16/09/2020 16:35, Daniel wrote:
> El miércoles, 16 de septiembre de 2020 a las 12:58:58 UTC+2, Dmitry A. Kazakov escribió:
>> On 16/09/2020 12:23, Daniel wrote:
>>> El miércoles, 16 de septiembre de 2020 a las 9:14:23 UTC+2, Dmitry A. Kazakov escribió:
>>
>>> Let's try to set and construct all hidden part details from Internal side, not from user side.
>> [...]
>>
>> Assuming "internal side" means "implementation side", this is in clear
>> contradiction with the code you posted. Your package Internal is
>> implementation and thus must be able to access whatever implementation
>> details it needs.
>>
>> Otherwise the API must provide means of construction. [Must be done
>> anyway in order to ensure the contract of Handle, provided default
>> initialization does not do that.]
> 
> Then, I assume there is not a clear solution in Ada due to my imposed requirements

Why? It is not in requirements, it is solely your design.

I see no reason why the package Internal.CallbacksPool must be limited 
to the public API. But I also see no reason why public API does not 
provide means to construct fully functional handles.

> So if the "Implementation side" needs all details,

Implementation holds all details, per definition of implementation.

> I only think in two options :
> 1.- Put the details of implementation in a children package in the API hierarchy, and try to explain users to don't "with it". I can try to make it really empty in the public part of the children package and only put what its needed for the implementation.

1. Children packages can be private. You cannot with them from outside.

2. Nothing forces you to put anything into the public part of a public 
child package. With-ing it would expose nothing.

3. Packages can be nested and put into bodies of other packages. These 
will not exist as library packages for the user.

4. Packages can have separate bodies if become too large. These bodies 
are all private.

There are lots of ways to make things private in Ada.

[There are a few cases when privacy does not work in Ada, but none of 
those are related to your problem]

> 2.- Take out the details from "API hierarchy packages" to the "Implementation package hierarchy" and make visible everything I need in the "API side", and try also to explain users to don't use them.

There is absolutely no need doing this.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  parent reply	other threads:[~2020-09-16 15:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 10:37 Visibility issue Daniel
2020-09-11 11:51 ` Maxim Reznik
2020-09-11 20:11   ` Daniel
2020-09-11 14:23 ` Jeffrey R. Carter
2020-09-11 20:17   ` Daniel
2020-09-11 22:36     ` Jeffrey R. Carter
2020-09-14 10:47       ` Daniel
2020-09-14 16:10         ` Jeffrey R. Carter
2020-09-15 19:11           ` Daniel
2020-09-15 20:03             ` Jeffrey R. Carter
2020-09-11 21:05 ` Dmitry A. Kazakov
2020-09-14 11:33   ` Daniel
2020-09-14 14:42     ` Dmitry A. Kazakov
2020-09-15 19:35       ` Daniel
2020-09-16  7:14         ` Dmitry A. Kazakov
2020-09-16 10:23           ` Daniel
2020-09-16 10:58             ` Dmitry A. Kazakov
2020-09-16 14:35               ` Daniel
2020-09-16 14:49                 ` Jeffrey R. Carter
2020-09-16 15:05                 ` Dmitry A. Kazakov [this message]
2020-09-16 20:09                   ` Daniel
2020-09-16 21:48                     ` Simon Wright
2020-09-17 13:31                       ` Daniel
2020-09-17 15:00                         ` Dmitry A. Kazakov
2020-09-17 15:32                           ` Daniel
2020-09-17 16:47                             ` Dmitry A. Kazakov
2020-09-18  8:05                         ` Simon Wright
2020-09-14 16:18 ` Simon Wright
2020-09-17 15:58 ` Jere
2020-09-17 16:10 ` Jere
2020-09-18  8:08   ` Simon Wright
2020-09-17 21:47 ` Shark8
replies disabled

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