RE: How To : Delegates
RE: How To : Delegates
- Subject: RE: How To : Delegates
- From: Andy Beier <email@hidden>
- Date: Wed, 26 Jan 2005 17:52:07 -0700
- Thread-topic: How To : Delegates
>From what I understand that is correct. As long as the class you set as
the delegate implements the correct method(s) with arguments it can be
any class.
Andy
-----Original Message-----
From: webobjects-dev-bounces+abeier=email@hidden
[mailto:webobjects-dev-bounces+abeier=email@hidden] On Behalf
Of Art Isbell
Sent: Wednesday, January 26, 2005 5:33 PM
To: List WebObjects
Subject: Re: How To : Delegates
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:
This email sent to email@hidden
_______________________________________________
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