comp.lang.ada
 help / color / mirror / Atom feed
* Private Child Unit
@ 1996-11-28  0:00 Paul Chardon
  1996-12-01  0:00 ` Tom Moran
  1996-12-02  0:00 ` Michel Gauthier
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Chardon @ 1996-11-28  0:00 UTC (permalink / raw)



Hello,

	Just to understand correctly the need of that concept, can anyone give
me a significant example of use of a private child unit.

	Thanks in advance, Paul




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Private Child Unit
  1996-11-28  0:00 Private Child Unit Paul Chardon
@ 1996-12-01  0:00 ` Tom Moran
  1996-12-03  0:00   ` Pascal Ledru
  1996-12-02  0:00 ` Michel Gauthier
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Moran @ 1996-12-01  0:00 UTC (permalink / raw)



Paul Chardon wrote:
> 
> Hello,
> 
>         Just to understand correctly the need of that concept, can anyone give
> me a significant example of use of a private child unit.
> 
>         Thanks in advance, Paul
In Claw (Class Library for Ada and Windows) there are various children
of Claw, some of which use a private child of Claw.  That private child
contains the thin Windows bindings (ie, the things with pragma Import
and Hungarian names).  Those low level things needn't/shouldn't be
visible to the application, but they certainly are needed by
Claw.Brushes, Claw.Menus, etc.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Private Child Unit
  1996-11-28  0:00 Private Child Unit Paul Chardon
  1996-12-01  0:00 ` Tom Moran
@ 1996-12-02  0:00 ` Michel Gauthier
  1 sibling, 0 replies; 4+ messages in thread
From: Michel Gauthier @ 1996-12-02  0:00 UTC (permalink / raw)



In article <329DB71E.59E2B600@avions.aerospatiale.fr>, Paul Chardon
<paul.chardon@avions.aerospatiale.fr> wrote:

>>          Just to understand correctly the need of that concept, can
anyone give
>>  me a significant example of use of a private child unit.

1= Assume a component P, or a hierarchy rooted thereof.
 Assume the body (or bodies) contains messages intended to
be displayed to some user.
 A private child P.Messages can be sensible to group these
messages in a way such that :
 - the messages are outside genericity (and possible constant duplication),
 - translated versions can be easily written.

2= Assume an abstract class with polymorphic implementations
declared in childs.
 Assume a collection of class-wide non-exported subprograms that are
called in some, but not all child bodies.
 A private child can be a choice better than declaring this collection
in the private part of the root.

However, I found many cases of generic units that are conceptually 
private, but cannot be private childs because they have to be 
instantiated in private parts (in order to re-export the type).

----------          ----------          ----------          ---------- 
Michel Gauthier / Laboratoire d'informatique
123 avenue Albert Thomas / F-87060 Limoges
telephone + 33 () 05 55 45 73 35  [or ~ 72 32]
fax +33 () 05 55 45 73 15  [or ~72 01]  
    no initial zero from abroad ! ! !
----------          ----------          ----------          ----------
Si l'an 2000 est pour vous un mysticisme stupide, utilisez la base 9
If you feel year 2000 a stupid mystic craze, use numeration base 9
----------          ----------          ----------          ----------




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Private Child Unit
  1996-12-01  0:00 ` Tom Moran
@ 1996-12-03  0:00   ` Pascal Ledru
  0 siblings, 0 replies; 4+ messages in thread
From: Pascal Ledru @ 1996-12-03  0:00 UTC (permalink / raw)



Here is a similar case:

I have a package Net_IO providing thick binding to networking functions
(e.g., Socket).
For example:
    function Socket(Af, Socket_Type, Protocol : Integer) return Socket_T
    ( which also raises an exception if necessary)
    This function calls a similar function frim the Winsock library
(thin binding):
    function socket(af, socket_type, protocol: C.Int) ...
    pragma Import(C, socket, "_socket@12");

All the thick binding functions are in the Net_IO package while the thin
binding functions
are in the private child package Net_IO.Winsock.

Ypu could argue that all the functions from the Net_IO.Winsock package
could be in the body
of Net_IO but using a private child package makes things more modular.

Pascal Ledru




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-12-03  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-28  0:00 Private Child Unit Paul Chardon
1996-12-01  0:00 ` Tom Moran
1996-12-03  0:00   ` Pascal Ledru
1996-12-02  0:00 ` Michel Gauthier

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