lundi 10 janvier 2022

Pattern/algorithm for sync arrays of similar objects, suggestions?

I wrote a class in PHP that represents a contact in an address book, every object has some attributes like names, email, phone number, etc... and it's saved in a database table. Now I'm many of these contacts and I need to keep them in sync with contacts in Google Contacts (I can access Google Contacts via Google People API).

Object from Google People API are different in structure from my class objects but this is not a big problem, my question is: what's the best pattern/algorithm to keep in sync two lists of objects? I need to synchronize creations, modifications and deletions between my software and Google Contacts...

Aucun commentaire:

Enregistrer un commentaire