Re: How To : Delegates
Re: How To : Delegates
- Subject: Re: How To : Delegates
- From: Chuck Hill <email@hidden>
- Date: Wed, 26 Jan 2005 16:46:43 -0800
And it is probably worth mentioning that delegation in WebObjects is
different than what is usually implemented for the Delegation pattern.
The "normal" (e.g. not in WO) method is to implement a interface in
your class and then implement the methods from the interface. Some
behind the scenes magic in WO frees you from needing to do this. All
you need to do is implement as much (or as little) of the delegate
interface as you want and the frameworks will figure out the details
for you. No fuss, no muss, clean and simple like we like it.
Thanks to whoever at Apple dreamt that up and implemented it.
Chuck
On Jan 26, 2005, at 4:32 PM, Art Isbell wrote:
On Jan 26, 2005, at 2:20 PM, Ray Ackland wrote:
As far as I am aware, your delegate doesn't need to be a subclass of
anything.
Correct
Just create a class that will do the delegate tasks, put methods in
there that are the delegate methods you are interested in, then
specify that your class is the delegate for your source class.
It's not even necessary to create a new class; you can implement
delegate methods on an existing class. The choice of a class to act
as a delegate should consider whether the delegate method depends on
any state, whether the delegate object will always exist when needed,
etc. An "esthetic" consideration might be whether the delegate object
is somehow "related" to the object that needs a delegate.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden