Symbian3/SDK/Source/GUID-30201A05-C6CE-5D34-9BDF-CDA4EE44878D.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-30201A05-C6CE-5D34-9BDF-CDA4EE44878D" xml:lang="en"><title>ECom
       
    13 Architecture</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>In C++, the existence of abstract base classes and virtual functions allows
       
    15 the programs to call, or access interfaces without knowing the actual implementation.
       
    16 This mechanism gives a flexibility of writing the implementation independent
       
    17 of the interface. The implementations are known as Plug-ins. </p>
       
    18 <p>When an application wishes to use a plug-in, an object is to be instantiated
       
    19 to perform the required processing. The object specifics are not known until
       
    20 run-time. The general characteristics of the processing are known, and these
       
    21 are presented as an interface API. </p>
       
    22 <p>In early versions of Symbian platform, implementations were provided by <xref href="GUID-6482956D-C3A3-5B68-A37F-4250C85B0D82.dita">polymorphic interface DLLs</xref>.
       
    23 All the frameworks within the Symbian platform that needed to use plug-ins
       
    24 had to provide own mechanisms for the clients to discover and instantiate
       
    25 the implementations. The above method resulted in duplication of functionality. </p>
       
    26 <p>The Plug-in (ECom) Framework introduces a generic framework that provides
       
    27 a single mechanism to: </p>
       
    28 <ul>
       
    29 <li id="GUID-6460F0E0-26A3-5038-B8C2-0F4706547600"><p>Register and discover
       
    30 interface implementations </p> </li>
       
    31 <li id="GUID-4045CA55-1286-5ACD-A532-240667125469"><p>Select an appropriate
       
    32 implementation </p> </li>
       
    33 <li id="GUID-78AE02BB-13BE-5DA0-B2F3-CC376654589B"><p>Provide version control
       
    34 for plug-ins </p> </li>
       
    35 </ul>
       
    36 <section id="GUID-561303EB-F0EA-4BB5-B7BB-3AE31176E79C"><title>Essentials of a Plug-In System</title> <p>A client wishes
       
    37 to access an object to perform some processing. The specifics of this object
       
    38 are not known until run-time. The general characteristics of the processing
       
    39 are known, and are defined in an interface, but several variants of required
       
    40 processing could exist, which are provided by implementations that support
       
    41 the interface. </p> <p>There are four clearly-defined roles in such a system. </p> <ul>
       
    42 <li id="GUID-B77969AC-EE5C-53C1-8906-07CF3B2BD11A"><p>The <b>Client</b> that
       
    43 wishes to access services. </p> </li>
       
    44 <li id="GUID-2E175B1C-7A50-5A00-BBF6-C54F2FC71FFA"><p>The <b>Interface API</b> that
       
    45 defines how to request services. </p> </li>
       
    46 <li id="GUID-C8F67E1A-2175-5093-BCFD-06BD90EF59C6"><p>The <b>Interface Implementation </b> that
       
    47 provides the required processing. </p> </li>
       
    48 <li id="GUID-A6817508-C5D1-5A7A-B50A-667272292362"><p>The <b>Framework</b> that
       
    49 provides the clients with the required access to the implementations. </p> </li>
       
    50 </ul> <p>The relationships can be represented as follows: </p> <fig id="GUID-185BDADA-4576-5175-B53B-03C2633E9EA0">
       
    51 <title>              Plug-in relationships            </title>
       
    52 <image href="GUID-F78F12AE-64CA-50BD-A715-8F254FBDB793_d0e179619_href.png" placement="inline"/>
       
    53 </fig> <p>The instantiation mechanism forms the backbone of such a system,
       
    54 and is responsible for providing the services that identify, and load the
       
    55 correct interface implementation at run-time. ECom is such a framework. </p> <p>We'll
       
    56 now look at the system from the perspectives in turn of each of the interface
       
    57 client, interface implementation, and interface definition, before summarising
       
    58 the functions of the ECom. </p> </section>
       
    59 </conbody></concept>