[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initial comments



2009/9/15 Shiro Kawai <shiro@xxxxxxxx>
...

What I expect when I see an immutable field is that,
literally, the value of the field doesn't change over
time, no matter what happens.  Thus I can cache the
value in the client side, for example.   Or I can avoid
locking to read the immutable fields, for no other thread
can possibly change their values.  It doesn't matter
whether the value can be changed by "private" methods
or not.  What matters is whether the value will ever
change or not.


As programmers themselves can make a data field to be mutable or immutable,
they can make a mutator-functioning method or not.

--
Joo