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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,66253344eaef63db X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,66253344eaef63db X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,66253344eaef63db X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 1994-09-29 14:33:04 PST Newsgroups: comp.lang.ada,comp.object,comp.lang.c++ Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!newsfeed.pitt.edu!uunet!ois!beckwb From: beckwb@ois.com (R. William Beckwith) Subject: Re: Mut. Recurs. in Ada9X w/o Breaking Encaps.? (LONG) Message-ID: Followup-To: comp.lang.ada,comp.object,comp.lang.c++ Organization: Objective Interface Systems, Inc. X-Newsreader: TIN version 1.2 PL2 References: <1994Sep27.165203.9192@swlvx2.msd.ray.com> <1994Sep27.184827.17813@wdl.loral.com> <1994Sep29.014611.20263@swlvx2.msd.ray.com> Date: Thu, 29 Sep 1994 18:10:42 GMT Xref: bga.com comp.lang.ada:6311 comp.object:6893 comp.lang.c++:30992 Date: 1994-09-29T18:10:42+00:00 List-Id: John Volan (jgv@swl.msd.ray.com) wrote: : MAB = mab@dst17.wdl.loral.com (Mark A Biggar) writes: snip : ... The only way the : client could get to that information would be to use an unchecked conversion to : change this "opaque" pointer into a pointer to the "non-opaque" Office subclass : below. (I think folks in the other languages would call this "downcasting".) : But this practice breaks type-safety! Actually the cool term is now `narrowing'. Narrowing the access type from access all Abstract_Office'class to access all Office'class does not break type saftey. Since Abstract_Office is abstract, there can be no objects of type Abstract_Office. Thus, Abstract_Office'class is always safely convertable to Office'class. This issue (we call it the "withing problem") is addressed in the CORBA IDL to Ada 9X mapping document. This mapping provides a nice solution to this issue that is very similiar to Mark's. The CORBA IDL to C++ mapping document defines C++ classes that are much more complex and cumbersome (IMHAARO) than non-CORBA C++ classes. I think the IDL to Ada 9X mapping provides a nice way to code Ada 9X even if you're not using CORBA. ... Bill -- e-mail: Bill.Beckwith@ois.com | Team Ada Objective Interface Systems, Inc. | dist, full O-O 1895 Preston White Drive, Suite 250 | multithreading Reston, VA 22091-5448 U.S.A. | built in