comp.lang.ada
 help / color / mirror / Atom feed
From: nospam@thanks.com.au (Don Harrison)
Subject: Re: Can't export object of private type
Date: 1999/03/03
Date: 1999-03-03T00:00:00+00:00	[thread overview]
Message-ID: <F7zxxG.1EI@syd.csa.com.au> (raw)
In-Reply-To: m3678k6v1x.fsf@mheaney.ni.net

Matt Heaney wrote:

:Of course, you could do it the way you suggest.  This is sort of an
:extreme example, where you have a family of types, and each type in the
:family has a singleton instance.  
:
:I don't know why Don wants to do this (I've certainly never had such a
:need), but I wanted to show that it is possible, and that in fact the
:implementation is relatively simple.

The actual context is..

A family of handlers is needed, each of which processes a specific type of 
data item received over an external interface. 

There should be one such handler per data item type and handlers share 
common behaviour.

The handlers also need to be processed as a group (eg. for resetting state)
so need to be storable in a polymorphic collection which may be processed 
by iterating over its elements.

Hence, the requirement for a family of tagged singletons.

Note, BTW, that the primitive operations for processing data items must 
belong to the handler hierarchy (rather than a parallel data item hierarchy) 
in the interests of faithful modelling. (IMO, implementations in which 
objects process themselves are nonsensical. One such example in the Ada 
Rationale has alerts handling themselves!).

:It will take some time for programmers to grok the concept of limited
:and indefinite types, and what it's buying you.  

They're somewhat tortured souls. Types whose objects:

  a) Must be (initialised when declared so they are constrained), yet
  b) Can't be (initialised by clients because they are limited), so
  c) Aren't (declarable by clients - a) and b) are contradictory for clients).

:I have a few examples
:of this idiom in the ACM patterns archive.
:
:<http://www.acm.org/archives/patterns.html>

Looks like you have some good stuff here. Thanks for publicising it.

:I'm working on another pattern now that was inspired by this thread.  An
:abstract factory, implemented using smart pointers, is used to
:initialize a singleton instance of a limited and indefinite type.  Whew!
:I'll post an announcement on CLA once it has been submitted (probably
:tomorrow or the day after.)

Interesting.


-- 
Don (Harrison).   donh at syd.csa.com.au






  parent reply	other threads:[~1999-03-03  0:00 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F7JoCB.JxB@syd.csa.com.au>
1999-02-24  0:00 ` Can't export object of private type Don Harrison
1999-02-24  0:00   ` Samuel Mize
1999-02-24  0:00     ` Tucker Taft
1999-02-25  0:00     ` Don Harrison
1999-02-25  0:00       ` robert_dewar
1999-02-26  0:00         ` Don Harrison
1999-02-26  0:00           ` robert_dewar
1999-02-26  0:00             ` dennison
1999-02-26  0:00             ` bourguet
1999-02-26  0:00               ` Samuel T. Harris
1999-02-27  0:00                 ` Simon Wright
1999-02-27  0:00                 ` Jean-Pierre Rosen
1999-02-28  0:00               ` dewar
1999-03-01  0:00                 ` bourguet
1999-03-01  0:00             ` Don Harrison
1999-03-01  0:00               ` robert_dewar
1999-03-03  0:00                 ` Don Harrison
1999-03-03  0:00                   ` robert_dewar
1999-03-01  0:00             ` Stephen Leake
1999-02-27  0:00         ` Brian Rogoff
1999-03-01  0:00           ` robert_dewar
1999-02-25  0:00       ` Samuel Mize
1999-02-26  0:00         ` Don Harrison
1999-02-27  0:00           ` Nick Roberts
1999-03-01  0:00             ` Don Harrison
1999-03-02  0:00               ` Matthew Heaney
1999-03-01  0:00             ` Don Harrison
1999-03-01  0:00               ` Nick Roberts
1999-03-01  0:00                 ` Don Harrison
1999-03-02  0:00                   ` Matthew Heaney
1999-03-03  0:00                     ` Don Harrison
1999-03-03  0:00                       ` Samuel Mize
1999-03-04  0:00                         ` Don Harrison
1999-03-07  0:00                     ` Ehud Lamm
1999-03-01  0:00               ` Matthew Heaney
1999-03-01  0:00                 ` Nick Roberts
1999-03-03  0:00               ` Robert A Duff
1999-03-04  0:00                 ` Don Harrison
1999-03-04  0:00                   ` Robert A Duff
1999-02-28  0:00         ` Matthew Heaney
1999-03-01  0:00           ` Samuel Mize
1999-03-01  0:00           ` Nick Roberts
1999-03-01  0:00             ` Matthew Heaney
1999-03-01  0:00             ` Matthew Heaney
1999-03-02  0:00               ` Nick Roberts
1999-02-25  0:00       ` fraser
1999-02-26  0:00         ` Don Harrison
1999-02-26  0:00           ` Samuel Mize
1999-03-01  0:00             ` Don Harrison
1999-03-01  0:00               ` Matthew Heaney
1999-03-02  0:00               ` fraser
1999-03-03  0:00                 ` Don Harrison
     [not found]           ` <7b6nqe$75m$1@remarq.com>
1999-02-26  0:00             ` fraser
1999-02-27  0:00               ` Nick Roberts
1999-02-26  0:00           ` fraser
1999-03-01  0:00             ` Don Harrison
1999-03-01  0:00               ` Matthew Heaney
1999-02-28  0:00           ` Matthew Heaney
1999-02-28  0:00         ` Matthew Heaney
1999-02-28  0:00       ` Matthew Heaney
1999-03-01  0:00       ` Tom Moran
1999-03-02  0:00         ` Matthew Heaney
1999-03-02  0:00           ` Tom Moran
1999-03-02  0:00             ` Matthew Heaney
1999-03-02  0:00               ` Tom Moran
1999-03-02  0:00                 ` Matthew Heaney
1999-03-02  0:00                   ` nabbasi
1999-03-02  0:00                     ` Matthew Heaney
1999-03-03  0:00                   ` Don Harrison [this message]
1999-03-03  0:00                     ` Single Extension; Polymorphic Arrays Nick Roberts
1999-03-03  0:00                       ` Nick Roberts
1999-03-08  0:00                         ` Matthew Heaney
1999-03-08  0:00                           ` Tucker Taft
     [not found]                             ` <m3ogm40wav.fsf@mheaney.ni.net>
1999-03-08  0:00                               ` Tucker Taft
1999-03-08  0:00                                 ` dennison
1999-03-09  0:00                                 ` Nick Roberts
1999-03-08  0:00                               ` Nick Roberts
1999-03-08  0:00                           ` Nick Roberts
1999-03-03  0:00               ` Can't export object of private type Don Harrison
1999-03-03  0:00                 ` Don Harrison
1999-03-03  0:00                   ` Nick Roberts
1999-03-04  0:00                     ` Don Harrison
1999-03-04  0:00                       ` fraser
1999-03-09  0:00                         ` Don Harrison
1999-03-04  0:00                       ` Nick Roberts
1999-03-08  0:00                         ` Matthew Heaney
1999-03-09  0:00                         ` Don Harrison
1999-03-09  0:00                           ` Matthew Heaney
1999-03-09  0:00                             ` Nick Roberts
1999-03-10  0:00                             ` Don Harrison
1999-03-10  0:00                               ` Matthew Heaney
1999-03-04  0:00                       ` Nick Roberts
1999-03-04  0:00                         ` robert_dewar
1999-03-05  0:00                           ` Nick Roberts
1999-03-05  0:00                         ` Robert A Duff
1999-03-05  0:00                           ` Abstract Subprograms of Untagged Types Nick Roberts
1999-03-05  0:00                             ` robert_dewar
1999-03-05  0:00                             ` Tucker Taft
1999-03-05  0:00                               ` Nick Roberts
1999-03-06  0:00                               ` robert_dewar
1999-03-08  0:00                     ` Can't export object of private type Matthew Heaney
1999-03-08  0:00                       ` Nick Roberts
1999-03-08  0:00                 ` Matthew Heaney
1999-03-10  0:00                   ` Don Harrison
1999-03-10  0:00                     ` Matthew Heaney
1999-03-10  0:00                       ` dennison
1999-03-10  0:00                         ` Robert A Duff
1999-03-10  0:00                           ` robert_dewar
1999-03-10  0:00                           ` dennison
1999-03-11  0:00                             ` dennison
1999-03-10  0:00                         ` robert_dewar
1999-03-10  0:00                           ` dennison
1999-03-10  0:00                             ` robert_dewar
1999-03-10  0:00                               ` dennison
1999-03-11  0:00                                 ` bill
1999-03-11  0:00                                   ` dennison
1999-03-11  0:00                                   ` Scott Ingram
1999-03-11  0:00                                     ` Larry Kilgallen
1999-03-12  0:00                                   ` dewar
1999-03-11  0:00                                 ` dennison
1999-03-11  0:00                                 ` robert_dewar
1999-03-11  0:00                                   ` Don Harrison
1999-03-12  0:00                                     ` robert_dewar
1999-03-11  0:00                           ` Don Harrison
1999-03-03  0:00           ` Don Harrison
1999-02-28  0:00     ` Matthew Heaney
1999-02-24  0:00   ` Tom Moran
1999-02-28  0:00   ` Matthew Heaney
replies disabled

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