I disagree with Charles regarding the first pillar.
Igor Donin
1

That’s the point, if your setters does not change the state, but create a new object and return it, then your encapsulation is not broken. Although one would argue that its not encapsulation. Its immutability.

Thats what map or filter does in a functional context, rather than mutating the existing array/collection, just return a new one.

Its exactly the same concept!

One clap, two clap, three clap, forty?

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