comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Protected vs. unprotected objects
Date: 1997/12/18
Date: 1997-12-18T00:00:00+00:00	[thread overview]
Message-ID: <ELD7HA.9w3.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 34984B64.163C@mitre.org


Terry Devine (tdevine@mitre.org) wrote:

: I'd like to be able to switch back and forth between protected and
: unprotected objects to be able to experiment with protection at various
: levels of a data structure.  However, if I read the LRM correctly, it
: would require major trauma (e.g., object.routine <-> routine(object)) .
: Does anyone have a good solution?

Probably use limited private types at each level of abstraction.
The full type definition for a limited private type can be a protected type.
The visible operations of the limited private type can just turn around
and call the protected operations where appropriate.  In other words,
use routine(object) everywhere, and only in the definition of "routine"
would you write "object.protected_routine(..)".  You could inline
the visible non-protected routines for efficiency, if you want.

: Terry Devine

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  parent reply	other threads:[~1997-12-18  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-17  0:00 Protected vs. unprotected objects Terry Devine
1997-12-18  0:00 ` Anonymous
1997-12-18  0:00 ` Tucker Taft [this message]
1997-12-19  0:00 ` Mats Weber
replies disabled

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