|
Posted by Curtis on 12/04/06 13:26
Tony Marston wrote:
> No, encapsulation is not about making everything private, it is about
> putting data and the operations which act upon that data into a single
> class. The ability to make certain operations or pieces of data private or
> protected is OPTIONAL, not MANDATORY.
I never claimed to summarize the entirety of encapsulation as the act
of making EVERYTHING private, I was merely restating in my own words to
try and clarify my understanding.
> I am not saying that you MUST NOT make things private/protected, I am simply
> arguing against the statement that you MUST use the private/protected
> option. The point is that his is entirely OPTIONAL and is a matter of
> personal preference.
You seem to be best friends with the straw man fallacy.
> As for saying that you MUST make all data private and access it through
> getters and setters, you obviously haven't read
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
The sources I've gathered, although differ slightly in diction,
generally concur on the meaning of encapsulation. It is true that not
all experts in a field will agree on everything, but the areas in which
there is genuine knowledge are not up for debate or subject to opinion.
You may be confusing semantics for the actual act of implementation, in
this case.
Please don't put words in my mouth. I never said that you MUST do
anything. Honestly, the source you cited is extremely dubious. Nearly
every comment questions Allen Holub's credibility. This is not an
authoritative source, by any means. One commenter even states:
"We have countless of examples of projects / systems that were and are
successful (the Java source code itself being one) using OO concepts
that are contrary to what Holub advocates. In other words, most of us
has been successful doing what he says we shouldn't do and what he
claims won't work well."
It's not my intention to sit here and argue, and I'm sure you have a
retort in waiting, so I'll just go study elsewhere until I have a
decent question that will be of worth to this newsgroup.
Curtis
[Back to original message]
|