The following example presents the identifier of a RAF service instance. The attribute values are arbitrary.
-
Simple Component Model
(Normative)
-
Introduction
The SLE API is based on the concept of integrating independently developed components with the SLE application. This concept has important advantages.
For instance, it allows an organization offering SLE services to provide an API Proxy component to the users for integration into SLE user applications.
In order to simplify integration of independently developed components by a third party, dependencies between the components must be minimized. In addition, the need for delivery of source code and of the required building procedures should be avoided as far as possible. Finally, there must be some means of customizing a component for the specific environment in which it shall be deployed.
These objectives are supported by component models. However, at the time this Recommended Practice was developed, component systems were just emerging and a commonly accepted, platform-independent scheme was not available. Of the existing models, the Component Object Model (COM) developed by Microsoft (see reference [ J 26]) was the only one that could be directly used with the C++ language. However, COM requires a special run-time library and the presence of the COM Registry. Dependency on a special run-time environment that might not be readily available on all platforms was not considered acceptable for the SLE API.
Therefore this Recommended Practice defines a very basic component model specifically for the SLE API. For this model it adopts a limited set of design patterns and conventions from COM. The conventions adopted are restricted to object interactions within the same address space and exclude detection and dynamic loading of components at runtime. The latter restriction implies that the COM library and the COM Registry are not needed.
The conventions and design patterns adopted from COM are:
-
Objects interact only via interfaces.
-
An interface is a collection of semantically related functions providing access to the services of an object. In C++, interfaces are specified by classes containing only public, pure virtual member functions. Interfaces can be derived from other interfaces.
-
Objects can implement more than one interface and support navigation between these interfaces. Interfaces are identified by a Globally Unique Identifier (GUID) assigned to every interface specification.
-
Interfaces are considered immutable once they have been published. If a modification must be applied, a new interface with a new identifier is created.
-
The lifetime of objects is controlled by reference counting. Methods to add a reference and to release a reference are provided by every interface.
-
To support navigation between interfaces and reference counting, every interface is derived from the interface IUnknown, specified by COM.
-
All non-object data structures passed across component boundaries must be allocated and de-allocated using a common memory manager that ensures consistency of dynamic memory management.
In
addition to these conventions, this Recommended Practice also adopts the scheme for definition of result codes from COM.
It is stressed that components developed according to this Recommended Practice do not conform to COM. Important differences to COM are listed in A.1.56.1.1.1.1.1.11. However, it is possible to develop and use SLE API components in a COM environment. It is also possible to write very simple COM conforming wrappers for the components conforming to this Recommended Practice.
The Simple Component Model defined for the SLE API does not claim to cover all features that can be expected from a full scope component model. In particular it does not support:
-
detection and dynamic loading of components;
-
distribution of components to different processes and across a network;
-
event handling;
-
persistent storage;
-
inspection of components; and
-
customization of components.
For
customization, this Recommended Practice uses the traditional concept of a configuration database, which is read by a component when a special method Configure() is called.
-
Components
Integration of independently developed components by a third party and substitutability is required only for the four API components identified in this Recommended Practice, namely:
-
the component API Proxy;
-
the component API Service Element;
-
the component SLE Operations; and
-
the component SLE Utilities.
Therefore the term ‘component’ is only used for these modules. These components are of considerable size and complexity and support a rather large number of interfaces. It is assumed that each component makes use of several classes and creates a number of objects during operations. Some of these objects will implement functionality, which is not directly visible outside of the component, but others must be accessed by the application or by other components. In the following, objects that are visible outside of a component are referred to as ‘component objects’.
The design patterns and conventions for component objects ensure that the component implementing them can be easily integrated with other API components into an SLE Application program. However, there is no requirement that a component object itself be self-contained or be individually substitutable.
It must be stressed that the concept of a component object is constrained to the external view of a component. There is no requirement that a component object is actually implemented by a single C++ object. A single component object may be implemented by co-operation of several C++ objects and a single C++ object could provide the implementation of more than one component object. This Recommended Practice makes no assumptions on the internal design or implementation of a component.
All conventions defined in this annex only apply to component objects. Therefore component objects are also referred to simply as ‘objects’ in this annex.
-
Share with your friends: