Encapsulation is supposed to prevent outside influence of anything within.
Lloyd Moore
2

Not really, no. Especially not in the case of system resources (which is the example he gave to “prove” that even keeping a copy of objects didn’t solve the problem). There are also other cases (such as passing listeners, callbacks, etc.) where you want other objects to interact with one of your fields… but still want the fields to be encapsulated (= only replaced or accessed using public methods).

But like I said: if you think that encapsulation means *no outside influence*, sure, I haven’t seen a case where that is hard to achieve with most OO languages (Java, C++). If you disagree, you can form your own “standard” that redefines what encapsulation means and writes new programming languages to conform with that, but I don’t think a lot of people worry about this as much as you guys do.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.