I'm having a problem deciding on how a Model object should be updated.

I have multiple resource objects that are represented in an
NSOutlineView. These resource objects can be updated by their own
triggered timer or potentially on demand by the user via the View (a
button is clicked in the UI).

At first, I thought that the resource object should have the
capability to update itself. Therefore, the resource has a method like
so:

[resource update];

If the resource's timer fires, it calls it's update method like so:

[self update];

If the resource update button is clicked by the user, the selected
resource item is updated by the NSWindowController with:

[resource update];

This is where I'm having difficulty determining what should be
standard practice. Would it be better to post a notification that
indicates the resource should update itself? Or is it good enough to
leave it as is?

One other approach I've considered is whether the Model should have
the ability to update itself at all. Should the controller be
responsible for updating the resource always?

It seems that either approach is viable, but which is better?

-Matt
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to