Item 26: Avoid Returning References to Internal Class Objects(Effective C#)
摘要:
You built the interfaceto your class, and you want users to follow it. You don’t want users to accessor modify the internal state of your objects without your knowledge.You’ve got four different strategies for protecting your internal data structuresfrom unintended modifications: value t 阅读全文
posted @ 2011-02-16 20:56 Ray Z 阅读(206) 评论(0) 推荐(0)