In the PlugIn Services model, the host application defines one or more types that each consist of one or more interfaces. A plug-in implements all of the functions in all of the interfaces for each type the plug-in supports. A plug-in also provides creation functions called factories for each type it wants to implement. When the host application loads a plug-in, a factory function is registered with the host for each of the plug-in's types. The host can then use a type's factory function to instantiate the type and obtain a pointer to its IUnknown interface. The host uses IUnknown to query the type for its interface function tables. The function tables give the host access to the plug-in's interface implementations. Figure 1-2 illustrates the relationships between these various components.
The following sections describe each aspect of the PlugIn Services model in detail. In addition, the section Core Foundation Plug-in Services Tasks provides a complete example of how to build a simple plug-in host and plug-in.