Re: Newb Question re Messaging and Return Values
Re: Newb Question re Messaging and Return Values
- Subject: Re: Newb Question re Messaging and Return Values
- From: Kevin Elliott <email@hidden>
- Date: Fri, 25 Jul 2008 16:13:10 -0700
On Jul 24, 2008, at 4:04 PM, Brad Gibbs wrote:
Looking at my problem further, I'm thinking I should make webServer
a delegate of each of the devices. That would allow me to
encapsulate the HTTP Posts and Gets for all of the devices in a
single class. A device's methods could invoke the webServer
delegate when they need to send information to the server or get
information back. The webServer delegate would return the response
to the device method that called the webServer method and that
method could parse the response and update the UI directly or
through an NSNotification.
Does this sound right?
Depends on what exactly you mean. If your planning to have lot of
device and one webServer, then I'd say no. Delegate work well with a
one to one relationship, not necessarily a one to many relationship.
What's the purpose of the webServer vs. device objects? Why do you
need a webServer object instead of just doing the work in the device
objects (this is not necessarily a criticism, just clarifying roles)?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden