--

Hi

In the first example, all setters are removed

In the second it not a setter. since it is not changing an attribute.

Providing a value (not a default) is an excellent way of making an object immutable

--

--

Maximiliano Contieri
Maximiliano Contieri

Written by Maximiliano Contieri

I’m a senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan. Maximilianocontieri.com

No responses yet