comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Package's private parts and protected types
Date: Tue, 9 Feb 2010 02:58:53 -0800 (PST)
Date: 2010-02-09T02:58:53-08:00	[thread overview]
Message-ID: <ecdbf9ec-ac29-428f-a658-8951fff34bb0@l19g2000yqb.googlegroups.com> (raw)
In-Reply-To: wccwrynkc7p.fsf@shell01.TheWorld.com

On 8 fév, 15:56, Robert A Duff <bobd...@shell01.TheWorld.com> wrote:
> "Hibou57 (Yannick Duchêne)" <yannick_duch...@yahoo.fr> writes:
> Private parts are a kludge in the first place, and the way
> they work with public protected types is even worse, as
> you pointed out.
>
> However, I think you can get the hiding you want by using
> a protected or synchronized interface.
>

protected, task and synchronized interface seems nice at first sight.
All three because they states what things are, while hiding
implementation details.
The third one especially, because the Synchronized tray in clean-
abstract (as the Ada 95 rationale says on purpose, there is mostly no
difference, from a client point of view, between a protected type and
a task type).

But these interfaces type are too much restrictive. As an example, it
does not allow to define a type which could be automatically allocated
in a local scope. It impose a design where the client must rely on
access to class-wide. This may be nice... but only it was decided to
be so. If something else was to be done, we face a no choice-path.

A direct consequence is also that it requires to use and manage
dynamic allocation in a none-clean way, as the client must make direct
use of an access type. If multiple types are to be defined with same
consequences for each, things become not clean at all.

I feel (at least from my point of view), the most practicable manner
is still to define a private type with primitives, and wrap things
inside that private type in the private part (so there may be no
better design than the initially introduced one).



  parent reply	other threads:[~2010-02-09 10:58 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  4:30 Package's private parts and protected types Hibou57 (Yannick Duchêne)
2010-02-08  8:30 ` Martin
2010-02-08  9:11   ` Hibou57 (Yannick Duchêne)
2010-02-08 10:10     ` Alex R. Mosteo
2010-02-08 10:46       ` Hibou57 (Yannick Duchêne)
2010-02-09 14:55         ` Alex R. Mosteo
2010-02-08 10:20   ` Dmitry A. Kazakov
2010-02-08 10:54     ` Hibou57 (Yannick Duchêne)
2010-02-08 10:58       ` Hibou57 (Yannick Duchêne)
2010-02-08 11:01       ` Dmitry A. Kazakov
2010-02-08 13:19         ` Georg Bauhaus
2010-02-08 15:17         ` Robert A Duff
2010-02-08 16:15           ` (see below)
2010-02-08 20:44             ` Robert A Duff
2010-02-08 22:00               ` Hibou57 (Yannick Duchêne)
2010-02-09  5:48               ` AdaMagica
2010-02-09 14:56                 ` Robert A Duff
2010-02-10  2:29                   ` Randy Brukardt
2010-02-11 23:46                     ` Robert A Duff
2010-02-12  1:29                       ` Randy Brukardt
2010-02-11 23:53                     ` Robert A Duff
2010-02-12  1:10                       ` Randy Brukardt
2010-02-10 16:05                   ` Adam Beneschan
2010-02-10 20:17                     ` sjw
2010-02-12  0:05                     ` Robert A Duff
2010-02-12 11:07                       ` Stephen Leake
2010-02-12 15:01                         ` Robert A Duff
2010-02-13  8:00                           ` Stephen Leake
2010-02-09  9:04               ` stefan-lucks
2010-02-08 17:11           ` Jeffrey R. Carter
2010-02-08 14:56       ` Robert A Duff
2010-02-08 15:36         ` Dmitry A. Kazakov
2010-02-08 16:06           ` Robert A Duff
2010-02-08 17:46             ` Jean-Pierre Rosen
2010-02-08 20:39               ` Robert A Duff
2010-02-08 21:54                 ` Hibou57 (Yannick Duchêne)
2010-02-08 21:50               ` Hibou57 (Yannick Duchêne)
2010-02-08 22:04         ` Hibou57 (Yannick Duchêne)
2010-02-09 10:58         ` Hibou57 (Yannick Duchêne) [this message]
2010-02-09 14:47           ` Robert A Duff
2010-02-09 19:34             ` Hibou57 (Yannick Duchêne)
2010-02-09 20:19               ` Hibou57 (Yannick Duchêne)
2010-02-09 23:29               ` Robert A Duff
2010-02-10  2:39               ` Randy Brukardt
2010-02-10  5:12                 ` Hibou57 (Yannick Duchêne)
2010-02-10  7:17                   ` Hibou57 (Yannick Duchêne)
2010-02-10 16:09                   ` Robert A Duff
2010-02-10 22:21                     ` Hibou57 (Yannick Duchêne)
2010-02-11  0:48                       ` Robert A Duff
2010-02-09  0:48     ` Randy Brukardt
2010-02-09 12:43     ` Hibou57 (Yannick Duchêne)
replies disabled

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