home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mcsun!sunic!sics.se!eua.ericsson.se!euas62c36!euamts
- From: euamts@eua.ericsson.se (Mats Henricson)
- Subject: Re: Private vs. Protected
- Message-ID: <1993Jan12.155429.7478@eua.ericsson.se>
- Sender: news@eua.ericsson.se
- Nntp-Posting-Host: euas62c36.eua.ericsson.se
- Reply-To: euamts@eua.ericsson.se
- Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
- References: <90218@ncratl.AtlantaGA.NCR.COM>
- Date: Tue, 12 Jan 1993 15:54:29 GMT
- Lines: 21
-
- In article 90218@ncratl.AtlantaGA.NCR.COM, vkessler@ncratl.AtlantaGA.NCR.COM (Vance Kessler) writes:
- #I would like to get your feelings as to when to use private versus when to use
- #protected.
- #
- #I generally make instance variables protected to give direct access to
- #sub-classes. But, I am thinking that it might make maintenance easier to make
- #them private and always access them through protected access functions.
- #
- #I would appreciate your opinions on this.
- #
- #Vance Kessler
- #vkessler@ncratl.atlantaga.ncr.com
-
- Our public domain coding standard recommends the second approach, i.e. make
- data private and let subclasses access them through protected access functions.
-
- Mats Henricson
- Ellemtel Telecom Systems Labs
- Stockholm
- Sweden
-
-