Ray's playground

 

2011年1月24日

Item 14: Minimize Duplicate Initialization Logic(Effective C#)

摘要: Here is theorder of operations for constructing the first instance of a type:  1. Static variable storage is set to 0.  2. Static variable initializers execute.  3. Static constructors for the base class execute.  4. The static constructor executes.  5. Instance variable storage is set to 0.  6. Ins 阅读全文

posted @ 2011-01-24 22:33 Ray Z 阅读(166) 评论(0) 推荐(0) 编辑

Item 15: Utilize using and try/finally for Resource Cleanup(Effective C#)

摘要: In some ways, resource management can be more difficult in C# than itwas in C++. You can’t rely on deterministic finalization to clean up everyresource you use. But a garbage-collected environment really is much simplerfor you. The vast majority of the types you make use of do not implementIDisposab 阅读全文

posted @ 2011-01-24 21:52 Ray Z 阅读(164) 评论(0) 推荐(0) 编辑

Helper Objects (Chapter 6 of Cocoa Programming for Mac OS X)

摘要: Many objects in the Cocoa framework are extended in much the same way. That is, there is an existing object that needs to be extended for your purpose. Instead of subclassing the table view, you simply supply it with a helper object. For example, when a table view is about to display itself, it 阅读全文

posted @ 2011-01-24 18:23 Ray Z 阅读(216) 评论(0) 推荐(0) 编辑

导航