, , , . , MaybeMutableFoo, MutableFoo ImmutableFoo. IsMutable AsMutable(), AsNewMutable() AsImmutable().
, MaybeMutableFoo read-write, , , IsMutable true. , MaybeMutableFoo, ImmutableFoo, , , , AsMutable(), foo ( , , ). MaybeMutableFoo setter, - , .
- , , .
public class MaybeMutableFoo
{
public string Foo {get {return Foo_get();} set {Foo_set(value);}
protected abstract string Foo_get();
protected abstract void Foo_set(string value};
}
ImmutableFoo :
new public string Foo {get {return Foo_get();}
Foo , Foo_get() Foo_set(). , Foo get; , , , . , getter setter, , .