Closed sunnyratilal closed 7 years ago
Sync Coordinators are now working with sales, file download logs, customers and payments.
I absolutely agree that a Sync Coordinator should be implemented alongside change processors as they... I'm just kidding... I have no idea what you are talking about.
Sync Coordinators and Change Processors are working in conjunction with the EDD REST APi.
I'm glad you followed my advice
A
SyncCoordinator
class needs to be introduced which will handle syncing the app with the EDD API.The
AppDelegate
is in charge of creating the sync coordinator. The sync code will work in the background on its own private background queue and context. Observers need to be set up so that the UI simply observes said changes to its context and objects.The Sync Coordinator will implement a Context Owner protocol which has two main responsibilities: merge the changes between the UI and the sync managed object context and feed local changes made by the UI into the sync architecture
The Sync Coordinator will need to own the Core Data context, the EDD API wrapper object and the change processors. The change processors contain domain-specific knowledge. A Transport Session will feed directly into the change processor - the
EDDAPIWrapper
is the transport session in this case. The logic for the change processors is relatively simple. We will have two change processors:Downloader
andRemover
.