Chapter 14. Contracts: playing nicely with others
This chapter covers
- Contracts
- Sharing with other apps
- Implementing search
Over the years, desktop apps have used a variety of mechanisms to integrate with each other. We’ve seen shared memory, shared memory mapped files, regular flat C-style DLLs, ActiveX, classic COM (Component Object Model) and other forms of COM automation like the much-hated DCOM (Distributed COM), DDE (Dynamic Data Exchange—remember that one?), socket communication, named pipes, and more. Each of these approaches had its good and bad points. Some, like DDE, were really brittle. Others, like COM, were complex to do well. Some like DCOM, no one ever really got working well. None of these mechanisms had any focus on the type of interaction; they were simply alternative ways to handle the app-to-app plumbing.
Windows 8 takes a different approach to app-to-app communication. Rather than focus on just the plumbing, the architects of Windows 8 took a step back and asked about the specific scenarios that should be supported. They then formalized the support for those into things called contracts.
Several of the more interesting contracts—Search, Share, and Settings, for example—are all exposed through the charms bar on the right (on a left-to-right machine) of the screen. Figure 14.1 shows the Windows charms bar.