Ray's playground

 

2011年2月10日

Item 20: Prefer Immutable Atomic Value Types(Effective C#)

摘要: 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. 阅读全文

posted @ 2011-02-10 21:24 Ray Z 阅读(135) 评论(0) 推荐(0)

Branching and Control Elements(Chapter 5 of XSLT 2nd Edition)

摘要: To invoke a template by name, two things have to happen: • The template you want to invoke has to have a name. • You use the <xsl:call-template> element to invoke the named template. The XSLT <xsl:template> element has a mode attribute that lets you pr 阅读全文

posted @ 2011-02-10 20:47 Ray Z 阅读(180) 评论(0) 推荐(0)

Key-Value Coding, Key-Value observing(Chapter 7 of Cocoa Programming for Mac OS X)

摘要: [代码]AppController.mCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1#import"AppController.h"23@implementationAppController45-(id)init6{7[superinit];8[selfsetValue:[NSNumbernumberWithInt:5]forKey:@"fido"];9NSNumber*n=[selfvalueF 阅读全文

posted @ 2011-02-10 10:33 Ray Z 阅读(190) 评论(0) 推荐(0)

导航