- Joined
- Jan 20, 2009
- Messages
- 21,122
- Likes received
- 773
- Thanks received
- 222
- Location
- Clown World
Exactly - so for anything but the simplest class imaginable, if you don't want to duplicate code all over the place you will have smaller reusable methods. Those methods are not meant to be exposed to the outside world because they are for manipulating the internal state.
So if you make them public you are breaking encapsulation because the outside world is now not restricted to interact via the appropriate public api; now they can **** about with the internal state of that object unrestricted.
Yes, unless you don't use private methods, and just have whacking great spaghetti public methods. As long as they are declared in an interface def, you're good to go. Soupy is a visionary and so far ahead of his time.
Tune in next week for his episode on "Inheritance isn't necessary", or "Abstraction is just an overhead".


