Xref: utzoo comp.lang.eiffel:1415 comp.object:2572 Path: utzoo!attcan!uunet!mcsun!ukc!mucs!logitek!hrc63!mrcu!paj From: paj@mrcu (Paul Johnson) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Inheritance and Information Hiding Message-ID: <808@puck.mrcu> Date: 28 Jan 91 09:44:22 GMT References: <1991Jan23.224203.3206@runx.oz.au> <1991Jan24.214652.18515@Think.COM> Reply-To: paj@uk.co.gec-mrc (Paul Johnson) Organization: GEC-Marconi Research Centre, Great Baddow, UK Lines: 34 Summary: Expires: Sender: Followup-To: >In article <1991Jan23.224203.3206@runx.oz.au> chrisv@runx.oz.au (Chris Velevitch) writes: >>I disagree with allowing a class to access inherited features that are >>not exported. It does not make sense that secret features are known to >>heir of a class. If a feature is not publicly known, then how can you >>know about the feature to use in the descendent class. > >I like C++'s solution to this, the private/protected/public distinction. I think the idea is that a child should be able to see all of its parents attributes so that the implementation is not constrained by the decisions of the parents' implementors. If someone decides to construct a class which inherits from a single parent simply to export more attributes then that is their buisness. They have designed and built a new class. If the interface is bad, or the invarients no longer hold or some similarly idiotic thing then that is the programmer's fault for producing a bad design. Eiffel is not a bondage and discipline language, and like any good language it will give the programmer plenty of rope. If he hangs himself, well he should have taken more care and heeded the safty warnings. The big advantage of Eiffel over C++ is that thanks to conceptual simplicity, all the dangerous things in Eiffel can be clearly signposted. C++ forces you to take the blade-guards off in order to use it. The private/protected/public system is just sugar and I cannot see how it helps anyone. I can see how it would get in their way though. Paul. -- Paul Johnson UUCP: !mcvax!ukc!gec-mrc!paj --------------------------------!-------------------------|------------------- GEC-Marconi Research is not | Telex: 995016 GECRES G | Tel: +44 245 73331 responsible for my opinions. | Inet: paj@uk.co.gec-mrc | Fax: +44 245 75244