阅读背景:

C#中不可变的对象模式 - 你怎么看?

来源:互联网 

I have over the course of a few projects developed a pattern for creating immutable (readonly) objects and immutable object graphs. Immutable objects carry the benefit of being 100% thread safe and can therefore be reused across threads. In my work I very often use this pattern in Web applications for configuration settings and other objects that I load and cache in memory. Cached objects should always be immutable as you want to guarantee they are not unexpectedly changed.I have over the course of a few projects develo




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: