comp.lang.ada
 help / color / mirror / Atom feed
From: Daniel <danielnorberto@gmail.com>
Subject: Re: Visibility issue
Date: Thu, 17 Sep 2020 06:31:28 -0700 (PDT)	[thread overview]
Message-ID: <a6a6053d-7ed9-47fa-a021-00bee31df07an@googlegroups.com> (raw)
In-Reply-To: <lyd02lo0k1.fsf@pushface.org>

El miércoles, 16 de septiembre de 2020 a las 23:48:34 UTC+2, Simon Wright escribió:
> I still don't understand _why_. 
¿Why a tagged type in a callback function to send data to users?
It wasn't my decision. It's an imposed requirement.
(...yes sometimes I don't understand some requirements/limitations neither.)

> Purely from the visibility aspect, 
> 
> package API is 
> function F return Integer; 
> private 
> Secret : constant := 42; 
> end API; 
> 
> private package API.Impl is 
> Altered : constant := Secret / 2; 
> end API.Impl; 
> 
> with API.Impl; 
> package body API is 
> function F return Integer is (Impl.Altered); 
> end API;

ok Lets try to fit this requirement:
>"There will be one or more internal packages not visible to users where information is created. Preferably not in API hierarchy"
Let's ignore for now "why" this requirement and how reasonable is it. For example lets think for that the information comes from a data link implemented in other packages different to API.
In your example, all data is generated and processed within API packages, but the requirement obligates the data generated outside have to be send to users through API elements. (API just process it, but not generate it)

package Internal is
Secret : Natural :=0;
procedure Create_Data is
begin
   Secret :=Secret + 1;
end Create_Data;

You need to give this Data to Users using API. Let's think in easy example where Data gived to Users is Secret_Data / 2.

¿How is the better way to do it and in the same time not affect too much they way users see and use the API?



  reply	other threads:[~2020-09-17 13:31 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
2020-09-16 20:09                   ` Daniel
2020-09-16 21:48                     ` Simon Wright
2020-09-17 13:31                       ` Daniel [this message]
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