Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.lang.c++ Subject: Data vs. function members (was Re: Critique of Wiener/Pinson) Message-ID: <10250@ulysses.homer.nj.att.com> Date: 21 Apr 88 04:33:06 GMT References: <8063@apple.Apple.Com> <6590039@hplsla.HP.COM> Sender: netnews@ulysses.homer.nj.att.com Reply-To: jss@hector (Jerry Schwarz) Organization: AT&T Bell Labs, Murray Hill Lines: 21 In article <6590039@hplsla.HP.COM> jima@hplsla.HP.COM (Jim Adcock) writes: > >Again, not true -- the issue is public vs non-public, it is not an issue >of access functions or not access functions. Change the meaning of >any part of your public interface, either instance variable or function, >and your class's users will be hosed. It is easy to overlook a subtle point. When you make available a value through a member function, the only thing you are putting into the public interface is access to a value. When you make it available as a data member you are also putting into the interface the operation of changing that value. Further you are committing yourself to the implmentation of this operation as a simple assignment. Whether you want to put the assignment operation into the interface is a decision to be made individually for each value. My experience has been that the commitment to an implementation of assignment is a significant constraint on future changes to a class. Jerry Schwarz Bell Labs, Murray Hill