Immutable types are simpler to code and easier to maintain. Don’t blindly create get and set accessors for every property in your type. Your first choice for types that store data should be immutable, atomic value types. You easily can build more complicated structures from these entities.
转载于:https://www.cnblogs.com/zhtf2014/archive/2011/02/10/1950956.html