From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,95b198768e6c3970 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Protected vs. unprotected objects Date: 1997/12/18 Message-ID: #1/1 X-Deja-AN: 299217037 Sender: news@inmet.camb.inmet.com (USENET news) References: <34984B64.163C@mitre.org> X-Nntp-Posting-Host: houdini.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-12-18T00:00:00+00:00 List-Id: 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