Yes, that looks reasonable.
However, I would also talk about “leaky” variability. For instance:
public class AppearsImmutableButIsntDeeplyImmutable
{
private readonly StringBuilder builder = new StringBuilder();
public StringBuilder Builder { get { return builder; } }
}
I cannot change which instance I built, but I can do:
value.Builder.Append("hello");
It would be helpful to read Eric Lippert's blog post on types of immutability - and indeed all the other posts in the series.
source
share