Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 15. Delegates > Consequences

Consequences

The Delegates pattern dramatically reduces the need to subclass Cocoa objects to implement application-specific behavior. Many of the more complex Cocoa classes such as NSApplication, NSBrowser, NSTableView, NSText, and NSWindow are rarely if ever subclassed because the Delegates pattern provides a better alternative.

The Delegates pattern reduces the coupling between objects. Subclassing creates the tightest possible coupling between the subclass and its superclass. The Delegates pattern substitutes a much looser relationship based on anonymous objects. The coupling between an object and its delegate is so loose that the object can function without any delegate at all, and a delegate is free to implement any subset of the potential delegate methods.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial