home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 19006 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!sunic!sics.se!eua.ericsson.se!euas62c36!euamts
  3. From: euamts@eua.ericsson.se (Mats Henricson)
  4. Subject: Re: Private vs. Protected
  5. Message-ID: <1993Jan12.155429.7478@eua.ericsson.se>
  6. Sender: news@eua.ericsson.se
  7. Nntp-Posting-Host: euas62c36.eua.ericsson.se
  8. Reply-To: euamts@eua.ericsson.se
  9. Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
  10. References: <90218@ncratl.AtlantaGA.NCR.COM>
  11. Date: Tue, 12 Jan 1993 15:54:29 GMT
  12. Lines: 21
  13.  
  14. In article 90218@ncratl.AtlantaGA.NCR.COM, vkessler@ncratl.AtlantaGA.NCR.COM (Vance Kessler) writes:
  15. #I would like to get your feelings as to when to use private versus when to use
  16. #protected.
  17. #
  18. #I generally make instance variables protected to give direct access to
  19. #sub-classes.  But, I am thinking that it might make maintenance easier to make
  20. #them private and always access them through protected access functions.
  21. #
  22. #I would appreciate your opinions on this.
  23. #
  24. #Vance Kessler
  25. #vkessler@ncratl.atlantaga.ncr.com
  26.  
  27. Our public domain coding standard recommends the second approach, i.e. make
  28. data private and let subclasses access them through protected access functions.
  29.  
  30. Mats Henricson
  31. Ellemtel Telecom Systems Labs
  32. Stockholm
  33. Sweden
  34.  
  35.