ECOMYesSymbianThe general architecture of the operating system. It provides and uses various functions through the plug-in module. To useECOM, We should know how to use the programECOMArchitecture to access the plug-in, how to define the abstract interface that a plug-in can implement, and how to implement the plug-in.
In C ++, abstract basic classes and functions mean that the program can call and access interfaces without knowing the specific classes to be implemented. This is a very useful mechanism, which allows us to define an interface first, and then write the code that implements this interface. This implementation is the plug-in we know.
InSymbianIn earlier versions of the operating system, this implementation was implemented by the dynamic Connection Library of the multi-state interface. This means that allSymbianThe plug-in framework must not provide their own mechanisms for customers to discover and instantiate available implementations.
WhileECOMA general framework is introduced to remove these repeated features.
Is the plug-in we know ). This framework provides a single mechanism
1. Registration and discovery interface implementation.
2. select an appropriate implementation
3. Provides plug-in version control.
To find outECOMHow to do this. Let's take a look at the nature of any plug-in system. First, a client wants to access an object to complete some processing. We do not know the details of this object until it is run. The basic features of these processes are known and defined in interfaces, but there may be several variables required for processing. These variables are provided by the implementation that supports this interface.
There are four clearly defined roles in such a system.
1. The client that you want to access the service.
2. How to obtain the service interface.
3. Provide the interface implementation to be processed.
4. allow customers to access the implementation framework.
Their relationships are shown in the following UML diagram:
The instantiation mechanism forms the hub of the system, which is responsible for providing services for identifying and loading the correct interface implementation at runtime.ECOMIs such a framework.
In summaryECOMWe will examine this system from the perspective of interface clients, interface implementations, and interface definitions.
Interface client:
UseECOMThe implemented plug-in framework client uses the C ++ interface provided by the framework and does not require any additional steps. The entire client needs to do the following:
1. ConnectECOMFramework library,ECOM. Lib
2. Include interface definition file (. h header file)
3. Obtain an object through the newl () function of the interface. Generally, the client will pass some data to indicate the characteristics of the object it requires. The client can also directly transmit some data to the object.
4. Use object
5. When the use ends, delete the object.
6. Call recomsession: finalclose () to clear the memory.
Interface Definition:
PairECOMFor the framework plug-ins, the interface definition has two purposes.
1. It defines the functions that provide services to the customer. These functions are generally pure vitual. The implementation provides specific functions by inheriting these interfaces.
2. It provides an Object Instantiation function. This function does not need to create an interface definition class instance: instead, it usesECOMCreate a required implementation interface and return it to the client. Similarly, the Destructor notification of the interfaceECOMThis object is destroyed, as shown in ).
Generally, the interface definition is providedECOMAn indication indicates the available implementation that should be used. this indication can be direct. For example, it can be used to identify the UID of a specific implementation, or indirectly, such as the data corresponding to an implementation self-description.
This kind of choice processing is not called resolution, but the entity implementing it is called resolver.ECOMA default resolver is provided, but if needed, the interface definition can provide their own dedicated Resolvers.
ECOMYesSymbianThe general architecture of the operating system. It provides and uses various functions through the plug-in module. To useECOM, We should know how to use the programECOMArchitecture to access the plug-in, how to define the abstract interface that a plug-in can implement, and how to implement the plug-in.
In C ++, abstract basic classes and functions mean that the program can call and access interfaces without knowing the specific classes to be implemented. This is a very useful mechanism, which allows us to define an interface first, and then write the code that implements this interface. This implementation is the plug-in we know.
InSymbianIn earlier versions of the operating system, this implementation was implemented by the dynamic Connection Library of the multi-state interface. This means that allSymbianThe plug-in framework must not provide their own mechanisms for customers to discover and instantiate available implementations.
WhileECOMA general framework is introduced to remove these repeated features.
Is the plug-in we know ). This framework provides a single mechanism
1. Registration and discovery interface implementation.
2. select an appropriate implementation
3. Provides plug-in version control.
To find outECOMHow to do this. Let's take a look at the nature of any plug-in system. First, a client wants to access an object to complete some processing. We do not know the details of this object until it is run. The basic features of these processes are known and defined in interfaces, but there may be several variables required for processing. These variables are provided by the implementation that supports this interface.
There are four clearly defined roles in such a system.
1. The client that you want to access the service.
2. How to obtain the service interface.
3. Provide the interface implementation to be processed.
4. allow customers to access the implementation framework.
Their relationships are shown in the following UML diagram:
The instantiation mechanism forms the hub of the system, which is responsible for providing services for identifying and loading the correct interface implementation at runtime.ECOMIs such a framework.
In summaryECOMWe will examine this system from the perspective of interface clients, interface implementations, and interface definitions.
Interface client:
UseECOMThe implemented plug-in framework client uses the C ++ interface provided by the framework and does not require any additional steps. The entire client needs to do the following:
1. ConnectECOMFramework library,ECOM. Lib
2. Include interface definition file (. h header file)
3. Obtain an object through the newl () function of the interface. Generally, the client will pass some data to indicate the characteristics of the object it requires. The client can also directly transmit some data to the object.
4. Use object
5. When the use ends, delete the object.
6. Call recomsession: finalclose () to clear the memory.
Interface Definition:
PairECOMFor the framework plug-ins, the interface definition has two purposes.
1. It defines the functions that provide services to the customer. These functions are generally pure vitual. The implementation provides specific functions by inheriting these interfaces.
2. It provides an Object Instantiation function. This function does not need to create an interface definition class instance: instead, it usesECOMCreate a required implementation interface and return it to the client. Similarly, the Destructor notification of the interfaceECOMThis object is destroyed, as shown in ).
Generally, the interface definition is providedECOMAn indication indicates the available implementation that should be used. this indication can be direct. For example, it can be used to identify the UID of a specific implementation, or indirectly, such as the data corresponding to an implementation self-description.
This kind of choice processing is not called resolution, but the entity implementing it is called resolver.ECOMA default resolver is provided, but if needed, the interface definition can provide their own dedicated Resolvers.