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: <F7zzxE.6sp@syd.csa.com.au> (raw)
In-Reply-To: m33e3o6tto.fsf@mheaney.ni.net

Matt Heaney wrote:

:nospam@thanks.com.au (Don Harrison) writes:
:
:> Sure. What I'm trying to acheive is a set of implementation techniques for 
:> OO design that:
:> 
:>   a) Are consistent at least from the perspective of client code. 
:>      For example, everything that is an object (including singletons) 
:>      *looks like* an object (and not a module).
:>   b) Map as directly as possible from the design.
:>   c) Are idiomatic Ada.
:
:The state machine package is "idiomatic Ada."  Your a) and c) goals may
:be in conflict.

Where possible, and where it makes sense, I want to leave open the 
possibility of reuse by inheritance as well as aggregation. Simple state 
machines won't allow this flexibility.

:As I have argued in previous posts, don't export a singleton instance of
:a type unless you have a compelling need to.  Types should really only
:be used to implement an abstraction that has an unbounded number of
:instances.
:
:If you know up front how many "instances" of an abstraction you have
:--what I call the "well-known objects" pattern-- then a state machine
:package is probably the way to go.  

Partitioning objects into "well-known" and less-well-known :)  will always 
be somewhat arbitrary. However, in the context of non-pure OOPLs (such as 
Ada), you're probably right in suggesting it's worth distinguishing between 
single-fixed-variant (your "well-known") objects and more general ones. 
The additional flexibility gained in declaring an explicit derivable type 
is a waste of time if future variants are unlikely.

[Matt's example]

:An abstract data type wouldn't buy you very much except syntactic
:overhead.

Agree.

:Thinking in terms of packages (or "modules", if you prefer that term) is
:fundamental to Ada programming.  If you're using singleton instances of
:types everywhere, motivated perhaps by some notion of "purity," then
:that may be a sign that you're fighting the language.

:) :)

:In a typical Ada application, some abstractions are implemented as state
:machine packages, and some abstractions are implemented as instances of
:an abstract data type.  There is nothing odd or unnatural about this.

It's certainly idiomatic.


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






  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       ` 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
1999-02-26  0:00           ` fraser
1999-03-01  0:00             ` Don Harrison
1999-03-01  0:00               ` Matthew Heaney
     [not found]           ` <7b6nqe$75m$1@remarq.com>
1999-02-26  0:00             ` fraser
1999-02-27  0:00               ` Nick Roberts
1999-02-28  0:00           ` Matthew Heaney
1999-02-28  0:00         ` Matthew Heaney
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-01  0:00               ` Matthew Heaney
1999-03-01  0:00                 ` Nick Roberts
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 [this message]
1999-03-03  0:00                       ` Samuel Mize
1999-03-04  0:00                         ` Don Harrison
1999-03-07  0:00                     ` Ehud Lamm
1999-03-03  0:00               ` Robert A Duff
1999-03-04  0:00                 ` Don Harrison
1999-03-04  0:00                   ` Robert A Duff
1999-03-01  0:00             ` Don Harrison
1999-03-02  0:00               ` Matthew Heaney
1999-02-28  0:00         ` Matthew Heaney
1999-03-01  0:00           ` Nick Roberts
1999-03-01  0:00             ` Matthew Heaney
1999-03-02  0:00               ` Nick Roberts
1999-03-01  0:00             ` Matthew Heaney
1999-03-01  0:00           ` Samuel Mize
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             ` bourguet
1999-02-26  0:00               ` Samuel T. Harris
1999-02-27  0:00                 ` Jean-Pierre Rosen
1999-02-27  0:00                 ` Simon Wright
1999-02-28  0:00               ` dewar
1999-03-01  0:00                 ` bourguet
1999-02-26  0:00             ` dennison
1999-03-01  0:00             ` Stephen Leake
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-02-27  0:00         ` Brian Rogoff
1999-03-01  0:00           ` robert_dewar
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
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                           ` Nick Roberts
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-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-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-04  0:00                       ` Can't export object of private type 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-08  0:00                     ` 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_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                                 ` 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                                 ` 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-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-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