The ActiveSync Architecture

As stated earlier, ActiveSync is concerned with the synchronization of data between the device and the desktop. It is interesting that the architecture is based on the concept of ActiveSync providers, so that a variety of synchronization types can be supported. When looking at this architecture, as Figure 6-5 shows, you'll notice that there are both desktop and device components and that both are based on COM.

Figure 6-5. The Architecture of ActiveSync. This diagram illustrates the desktop and device software used by ActiveSync.

graphics/06fig05.gif

In the remainder of this section, we'll briefly review the two primary components of the ActiveSync architecture, the Service Manager and ActiveSync providers.

ActiveSync Service Manager

The Service Manager is the core engine that executes the synchronization process. From Figure 6-5, you'll notice that it resides on both the device and desktop. It handles tasks such as establishing the connection between desktop and device, searching for changes in data by interacting with the registered providers (covered below), resolving conflicts based on rules configured in the ActiveSync client, and transferring the data. Acting as the manager of the synchronization process, the Service Manager does not decide which data to keep, delete, or transfer. These decisions are made in the ActiveSync providers.

ActiveSync Providers

An ActiveSync provider includes COM objects packaged in DLLs that implement the IReplObjHandler and IReplStore interfaces and that invoke the Windows CE functions shown in Figure 6-5. Each provider is responsible for synchronizing a specific type of data. Once registered in the official list of ActiveSync providers via the desktop registry, the ActiveSync Service Manager will interact with the provider object via the COM interfaces. Several providers ship with the ActiveSync software, including the Microsoft Outlook ActiveSync provider which synchronizes Outlook data on the desktop with the various Pocket applications on the device, including the inbox, calendar, contacts, tasks, and notes. Others exist as well, including the files provider, which we will use later in this chapter.

As mentioned previously, the ActiveSync provider consists of a pair of DLLs, one for the desktop and one for the device. Each must implement the requisite COM interfaces in order to be an official provider. Because COM must be used to create an ActiveSync provider and because COM Interop is not supported in this release of the Compact Framework, managed developers will have to wait for a future version to implement an ActiveSync provider in VS .NET. Until that time comes, as with file conversion filters, eVC must be used.