Delegates: Difference between revisions

Content added Content deleted
(→‎{{header|Tcl}}: adjust layout, make more resilient)
No edit summary
Line 1: Line 1:
{{task|Object oriented}}
{{task|Object oriented}}


A delegate is a helper object used by another object. The delegator may send the delegate certain messages, and provide a default implementation when there is no delegate or the delegate does not respond to a message. This pattern is heavily used in [http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_3.html#//apple_ref/doc/uid/TP40002974-CH6-DontLinkElementID_93 Cocoa framework on Mac OS X]
A delegate is a helper object used by another object. The delegator may send the delegate certain messages, and provide a default implementation when there is no delegate or the delegate does not respond to a message. This pattern is heavily used in [http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_3.html#//apple_ref/doc/uid/TP40002974-CH6-DontLinkElementID_93 Cocoa framework on Mac OS X]. See also [[wp:Delegation pattern]].


Objects responsibilities:
Objects responsibilities: