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
From http://mobile.tutsplus.com/tutorials/iphone/learn-objective-c-2/ :
In simple terms, the user is provided with what the developer wanted them to have, and “protects” everything else. The developer can change anything internal without the user having to rewrite their code.
If developers did not conform to data encapsulation, we would need to rewrite our code every time a new version of a library, code snippet, or an entire program was released.