Ray's playground

 

2011年2月16日

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)

Item 25: Implement the Event Pattern for Notifications(Effective C#)

摘要: Events provide a standard syntax for notifying listeners. The .NET EventPattern follows the event syntax to implement the Observer Pattern. Anynumber of clients can attach handlers to the events and process them.Those clients need not be known at compile time. Events don’t need subscribersfor 阅读全文

posted @ 2011-02-16 20:40 Ray Z 阅读(223) 评论(0) 推荐(0)

Basic Core Data(Chapter 11 of Cocoa Programming for Mac OS X)

摘要: Apple decided to make this type of application extremely easy to write: NSArrayControllerwill hold on to an array of objects. Bindings will eliminate much of the glue code that would be necessary to keep the model objects in sync with the views. NSManagedObjectContextwill observe the instance v 阅读全文

posted @ 2011-02-16 16:25 Ray Z 阅读(176) 评论(0) 推荐(0)

导航