In C++, the existence of abstract base classes and virtual functions allows the programs to call, or access interfaces without knowing the actual implementation. This mechanism gives a flexibility of writing the implementation independent of the interface. The implementations are known as Plug-ins.
When an application wishes to use a plug-in, an object is to be instantiated to perform the required processing. The object specifics are not known until run-time. The general characteristics of the processing are known, and these are presented as an interface API.
In early versions of Symbian platform, implementations were provided by polymorphic interface DLLs. All the frameworks within the Symbian platform that needed to use plug-ins had to provide own mechanisms for the clients to discover and instantiate the implementations. The above method resulted in duplication of functionality.
The Plug-in (ECom) Framework introduces a generic framework that provides a single mechanism to:
Register and discover interface implementations
Select an appropriate implementation
Provide version control for plug-ins
A client wishes to access an object to perform some processing. The specifics of this object are not known until run-time. The general characteristics of the processing are known, and are defined in an interface, but several variants of required processing could exist, which are provided by implementations that support the interface.
There are four clearly-defined roles in such a system.
The Client that wishes to access services.
The Interface API that defines how to request services.
The Interface Implementation that provides the required processing.
The Framework that provides the clients with the required access to the implementations.
The relationships can be represented as follows:
Figure: Plug-in relationships
The instantiation mechanism forms the backbone of such a system, and is responsible for providing the services that identify, and load the correct interface implementation at run-time. ECom is such a framework.
We'll now look at the system from the perspectives in turn of each of the interface client, interface implementation, and interface definition, before summarising the functions of the ECom.