Today I read a book and the author wrote that in a well-designed class the only way to access attributes is through one of that class methods. Is it a widely accepted thought? Why is it so important to encapsulate the attributes? What could be the consequences of not doing it? I read somewhere earlier that this improves security or somet...
Would anyone be able to explain to me what data encapsulation in Objective-C is? I've been told that this an important concept of Objective-C but I don't see why...
Explain it to me as if I was 5 and then as if I was 25....
Thanks for your time,
~Daniel
...
In all the code I've written, I have always made synchronization primitives wrapped in a single class. If my design ever produced an unencapsulated synch primitive, I redesigned until it was indeed encapsulated.
But is there a well-known design force or development circumstance (besides legacy code) that would require unencapsulated sy...