>So it's better to have base-protected-getters than protected variables?
Yes. Think of class design as a service and a client. The service supplies a guaranteed interface and the client uses the interface to do what it needs. This is most obvious in the public interface of a class for users of that class. However, it also applies to the protected interface of a class for the children of that class. If you make the internal data protected, it means that you can't ever change how the base class works or you'll break all of the clients, just like if you make the internal data public.
Last edited by Narue; Nov 19th, 2007 at 5:35 pm.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004