Xref: utzoo comp.lang.eiffel:1345 comp.object:2467 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!metro!ipso!runxtsa!chrisv From: chrisv@runx.oz.au (Chris Velevitch) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Inheritance and Information Hiding Keywords: oop, ood, Eiffel, inheritance, information hiding Message-ID: <1991Jan29.224905.3695@runx.oz.au> Date: 29 Jan 91 22:49:05 GMT References: <1991Jan23.224203.3206@runx.oz.au> <1991Jan24.214652.18515@Think.COM> Organization: RUNX Un*x Timeshare. Sydney, Australia. Lines: 27 In article <1991Jan24.214652.18515@Think.COM> barmar@think.com (Barry Margolin) writes: >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. >The private members of a class are only visible within the class, internal >to the "black box". Protected members are visible to derived classes; >frequently class derivation is used to extend behavior, in which case it is >reasonable to allow a more intimate relationship between the base class and >the subclasses, and protected members can be used for this. And public >members are fully exported. I can't see the real need for the protected members, because you are publicly announcing the existence of the members. You might as well just make them public. The class specifications remainings the same. I believe that by making features protected, you are making a supposition on how the class will be used. You may find that once having made it known the feature exists, a user will find a case in which they only want to buy the feature and not inherit it. -- Chris Velevitch RUNX Unix Timeshare | Internet: chrisv@runxtsa.runx.oz.au Sydney NSW, Australia. | UUCP: uunet!runxtsa.runx.oz.au!chrisv