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: fac41,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Design By Contract Date: 1997/09/04 Message-ID: #1/1 X-Deja-AN: 269902598 Distribution: world References: Organization: PSINet Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-04T00:00:00+00:00 List-Id: In article doylep@ecf.toronto.edu (Patrick Doyle) writes: > >mechanism is clearly "simpler". b) can be done at a certain level via > >appropriate combination of public/private children, but it is not as > >encompassing as selective export. Then again, I've never had the > >experience where this extra selectivity would have been useful. > > I had an experience where selective export was really useful. I was > writing a circuit simulator, and I was using the builder pattern to > decouple the representation of the circuit from its construction. I > created features to add components and join them with wires. > > Then there was a CIRCUIT_SIMULATOR class which managed the event > queue for a circuit. It needed the ability to cause the circuit to > enact events, but I didn't want the builder to be able to enact > events because a) the circuit is not complete and b) the output > channel for the results of the simulation is not yet ready. > > Thus, I exported the circuit's enact_event feature to CIRCUIT_SIMULATOR > and solved that problem in a very straightforward way. Yes, but this is a good example of something that private children are intended for and which is straightforward to achieve with them. It is not a counter example to the "extra selectivity" capability of selective export. /Jon -- Jon Anthony OMI, Belmont, MA 02178, 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari