Options for Building a Synchronization Provider
There are three options for building a synchronization provider in Windows 7: the Microsoft Sync Framework simple provider, the Microsoft Sync Framework custom provider, or implementing the Windows Sync interfaces to create a custom provider.
If you are building a synchronization provider that synchronizes only one data format and does not require any customization or special data filtering, then we recommend that you build a Microsoft Sync Framework simple provider. You have to implement only two interfaces:
- ISimpleSyncProvider
- IFullEnumerationProvider or IAnchorSyncProvider
For detailed information about the Microsoft Sync Framework and how to write a simple provider, see the Microsoft Sync Framework documentation.
The Microsoft Sync Framework custom provider allows you to take advantage of the Sync Framework implementations without being limited to a simple provider. You can customize your provider by writing your own implementations of interfaces such as IKnowledgeSyncProvider and ISynchronousDataRetriever, but you do not have to implement all of the interfaces yourself, as with Windows Sync.
For detailed information about the Microsoft Sync Framework and how to write a custom provider, see the Microsoft Sync Framework documentation.
Although it is more difficult to build a custom synchronization provider using Windows Sync, there are performance benefits to implementing the native interfaces directly. This might be an important consideration in some applications; for example, service-based applications.
The interfaces that you must implement to build a synchronization provider using Windows Sync are listed in the following table. For complete reference information about each of these interfaces, see the Windows Sync Reference section of this documentation.
IClockVectorElement | IFeedClockVectorElement | IClockVector |
IFeedClockVector | IEnumClockVector | IEnumFeedClockVector |
ICoreFragment | ICoreFragmentInspector | IRangeException |
IEnumRangeExceptions | ISingleItemException | IEnumSingleItemExceptions |
IChangeUnitException | IEnumChangeUnitExceptions | IReplicaKeyMap |
IConstructReplicaKeyMap | ISyncKnowledge | IForgottenKnowledge |
ISyncKnowledge2 | IRecoverableErrorData | ISyncChange |
ISyncChangeUnit | IRecoverableError | IChangeConflict |
ISyncCallback | ISyncProvider | ISyncSessionState |
ISyncSessionState2 | ISyncFilterInfo | ISyncFilterInfo2 |
IChangeUnitListFilterInfo | IEnumSyncChanges | ISyncChangeBuilder |
ISyncChangeBatchBase | ISyncChangeBatch | ISyncFullEnumerationChangeBatch |
ISyncChangeBatchAdvanced | IKnowledgeSyncProvider | IEnumSyncChangeUnits |
IDataRetrieverCallback | ILoadChangeContext | ISynchronousDataRetriever |
IAsynchronousDataRetriever | IFilterRequestCallback | IRequestFilteredSync |
ISupportFilteredSync | IProviderConverter |
The three most important interfaces for constructing a synchronization provider are ISyncKnowledge, ISyncProvider, and IKnowledgeSyncProvider.
- The ISyncKnowledge interface represents the metadata that describes all of the changes that have been applied to a data store, either directly or though synchronization. Implementing this interface is the biggest task in creating a provider. This interface is implemented for you when you create a Microsoft Sync Framework simple provider or a Microsoft Sync Framework custom provider. However, when you construct a provider using Windows Sync, you must implement this interface yourself.
- The ISyncProvider and IKnowledgeSyncProvider interfaces represent the synchronization provider. These interfaces are used by a synchronization session to synchronize data with another provider. When you build a custom provider using Windows Sync or the Microsoft Sync Framework, you must implement these interfaces. However, if you build a simple provider using the Microsoft Sync Framework, you will implement the ISimpleSyncProvider interface instead.