From -7253492803432692137
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109fba,ac06fef48c3c04df
X-Google-Attributes: gid109fba,public
X-Google-Thread: f78e5,ac06fef48c3c04df
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1995-02-01 17:04:55 PST
Path: nntp.gmd.de!Germany.EU.net!wizard.pn.com!satisfied.elf.com!news.mathworks.com!uunet!bah.com!news
From: Doug Judd <djudd@ads.com>
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: friends and local classes
Date: 2 Feb 1995 01:04:55 GMT
Organization: Booz-Allen & Hamillton
Lines: 36
Message-ID: <3gpb3n$nh4@booz.bah.com>
References: <FENSTER.95Jan24182929@ground.cs.columbia.edu> <3g5qc6$16p@news.cc.utah.edu> <3g5rei$dl8@news.panix.com> <9502801.16190@mulga.cs.mu.OZ.AU> <3glv86$dbg@hpsystem1.informatik.tu-muenchen.de>
NNTP-Posting-Host: vangogh.ads.com
Xref: nntp.gmd.de comp.lang.c++:88664 comp.std.c++:11293

schuenem@Informatik.TU-Muenchen.DE (Ulf Schuenemann) wrote:
> 
> [...]
>
> IMHO, for the sake of othogonality one should regard everything
> (including nested classes) inside a class as a member of that class.
> By definition a member has the _permission_ to access private members
> of what it is member of. This would not only go for memberfunctions
> but also for membertypes (ie nested classes), respectively its memberfunctions.
> 
> [...]

I disagree.  Take for example, an automobile engine class that
defines a carburetor class and battery class.   Should the
carburetor know about the battery?  When I go in to buy a new
carburetor, should I tell the clerk what type of battery I have?

I think not.

IMO, a well designed engineering application should be made up of
relatively independent, easily replaceable components with
well-defined interfaces.  Once class B needs to know about the
internal workings of class A (even if B is defined within A),
I feel that it is time to redefine A and B as a single class.

- Doug

 o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
 Doug Judd
 Advanced Decision Systems (Booz-Allen & Hamilton, Inc.) 
 1500 Plymouth St., Mountain View, CA 94043-1230
 djudd@ads.com, (415) 960-7450






