Re: Core Data Multiuser
Re: Core Data Multiuser
- Subject: Re: Core Data Multiuser
- From: Flavio Donadio <email@hidden>
- Date: Tue, 09 Oct 2012 16:58:21 -0300
On 09/10/2012, at 12:10, Alex Zavatone wrote:
> 3. If you want to have your GUI respond to changes in the DB, and you have no method to yap back to the GUI, then seems like you're going to have to poll.
>
> You might want to consider how to make the basic design work, then plan on ways that you can see that it will break. You've already outlined a few of them. Though you hate polling (I mostly agree), you can implement something better, a heartbeat, where when you initiate part of your GUI, you issue a request to happen in the future where you check "Am I still using this thing?" If so, update the time to check again and continue for another. If you're not, immediately write the change, lock the record and dismiss the heartbeat. It's polling yeah, but I'm trying to position it differently and it would only run when you have your edit button clicked.
This heartbeat idea is nice. I could implement this, but still also implement Keary's idea (user trying to edit a locked row will get a message saying who is currently editing it).
So, if the client hangs, disconnects (kind of wrong term, because it's HTTP) or loses power, after a certain number of missed heartbeats, changes are discarded and the row is unlocked.
If the user tries to edit a locked row, he/she gets notified that "<username> is editing this record now". He can then wait, call <username>'s extension, send a message, or simply throw something at him/her! :) After negotiating with the user that's editing the row, all that is needed is to refresh the view.
This way, I wouldn't even require early feedback about a record being locked or not. I think we can call this case closed (it's also gone a little off topic).
Thanks again for all the ideas!
Cheers,
Flavio
_______________________________________________
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