Re: Delegate versus Controller
Re: Delegate versus Controller
- Subject: Re: Delegate versus Controller
- From: Art Isbell <email@hidden>
- Date: Wed, 4 Jul 2001 13:55:26 -1000
On Wednesday, July 4, 2001, at 07:09 AM, Kenny Carruthers wrote:
How is using a delegate class different then subclassing?
(In this case,
subclassing NSWindow and overriding any window resizing calls.)
Delegate method invocations can occur within a method
implementation as opposed to at the start or end of a method
implementation. To duplicate that by subclassing, you'd need to
copy the method implementation into your overridden method and
insert the behavior implemented in an equivalent delegate method.
It's a lot easier to implement a delegate method versus a subclass.
Some classes are instantiated by other framework classes.
Substituting your subclass might not be supported.
Delegate methods can alter or enhance only certain
behaviors. Theoretically, a subclass can alter or enhance any
behavior.
Art Isbell
Apple iServices Technical Support
http://www.apple.com/iservices/webobjectssupport/
+1-808-591-0836