comp.lang.ada
 help / color / mirror / Atom feed
* Protected vs. unprotected objects
@ 1997-12-17  0:00 Terry Devine
  1997-12-18  0:00 ` Tucker Taft
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Terry Devine @ 1997-12-17  0:00 UTC (permalink / raw)



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?

Terry Devine




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

* Re: Protected vs. unprotected objects
  1997-12-17  0:00 Protected vs. unprotected objects Terry Devine
@ 1997-12-18  0:00 ` Tucker Taft
  1997-12-18  0:00 ` Anonymous
  1997-12-19  0:00 ` Mats Weber
  2 siblings, 0 replies; 4+ messages in thread
From: Tucker Taft @ 1997-12-18  0:00 UTC (permalink / raw)



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




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

* Re: Protected vs. unprotected objects
  1997-12-17  0:00 Protected vs. unprotected objects Terry Devine
  1997-12-18  0:00 ` Tucker Taft
@ 1997-12-18  0:00 ` Anonymous
  1997-12-19  0:00 ` Mats Weber
  2 siblings, 0 replies; 4+ messages in thread
From: Anonymous @ 1997-12-18  0:00 UTC (permalink / raw)



On Wed, 17 Dec 1997 17:00:04 -0500, 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?

Well, of course. Structure your application in terms of
Abstraction.Operation. "Abstraction" is a package. In the body of the
package, you can implement "Operation" in terms of a protected operation
or not, however you please, without major trauma to the rest of your
system.

This is a software engineering technique called "information hiding."

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"I waggle my private parts at your aunties."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/




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

* Re: Protected vs. unprotected objects
  1997-12-17  0:00 Protected vs. unprotected objects Terry Devine
  1997-12-18  0:00 ` Tucker Taft
  1997-12-18  0:00 ` Anonymous
@ 1997-12-19  0:00 ` Mats Weber
  2 siblings, 0 replies; 4+ messages in thread
From: Mats Weber @ 1997-12-19  0:00 UTC (permalink / raw)



Terry Devine 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?

One more vote in favor of package types :-)




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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-17  0:00 Protected vs. unprotected objects Terry Devine
1997-12-18  0:00 ` Tucker Taft
1997-12-18  0:00 ` Anonymous
1997-12-19  0:00 ` Mats Weber

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