Re: Dependent NSOperations (and best practices)
Re: Dependent NSOperations (and best practices)
- Subject: Re: Dependent NSOperations (and best practices)
- From: Andrew Merenbach <email@hidden>
- Date: Mon, 4 Aug 2008 08:57:55 -0700
On Aug 4, 2008, at 8:45 AM, I. Savant wrote:
I have a situation in which I am using two subclasses of
NSOperation: one is
to execute an algorithm (in this case, to simulate the rolling of
dice),
while the other is to log the result of that action. (I'm using an
operation for the logging since the logging can take some time due
to its
need to process the results of the first operation.)
You haven't mentioned whether you're making use of dependencies:
http://developer.apple.com/documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html#/
/apple_ref/doc/uid/TP40004591-RH2-SW14
(see "Operation Dependencies")
... I think the answer to that will determine much of (if not all)
the rest. :-)
--
I.S.
Wow! Although you and the other list members have my profuse
apologies for missing that, I thought that my case was so unique that
I didn't actually think to look for that particular aspect of
NSOperation -- right-under-the-nose, eh? -- and instead just came up
with the term on my own. I really appreciate your pointing that out,
I.S.
While I'll certainly examine that, looking at the docs don't seem to
quite answer the final question from my post (to quote myself):
... what happens if a logging operation is still in progress when
the main algorithm is stopped? Ideally, would one simply stop the
most recent logging operation? Stop all of them? Stop none of
them, and simply let them run their course? I can see cons to all
of these, and can't quite figure out what's best (e.g., for the
first, what if the most recent logging operation belongs to a
*previous* incarnation of the main algorithm, and not the one that's
presently running? For the second, what if the user doesn't want to
interrupt his or her logging, again for previous rolls, with the
cancellation of the main algorithm? and, for the third, what if the
user *wants* to interrupt one or all of the logging operations??).
While dependent operations may produce a particular behavior, or be
configurable to produce certain behaviors, what behavior would be a
best practice from a UI and user-experience perspective?
Anyway, thank you for your assistance!
Cheers,
Andrew
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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