Disclaimer. Trademark and Service Mark Notice. Creating the Interface Implementation. Technical or Customer Support

Страницы работы

Фрагмент текста работы

Various attributes, supplied to each parameter, describe how the parameter is used.

SetSNR takes an “in parameter” snr, which supplies the minimum acceptable signal to noise ratio. CompressImage takes an “in parameter” length, which specifies the number of supplied image elements, and returns an “out parameter” CompressedLength, which holds the corresponding number of elements in the compressed image. The array image is an “in-out parameter” that supplies the uncompressed elements and returns the compressed elements to the caller.

The description of an image compression service provided by a particular implementation of the IImageCmp interface may require extra information concerning usability, performance, and quality of service. This information, which is referred to as the operational specification of the interface, is provided by inserting special comments at appropriate points in the VIDL. As described later in this manual, VCSE provides a feature called auto-doc, which allows the contents of these comments to be extracted and converted into HTML.

IImageCmp is defined as an extension of a predefined interface IBase, which provides a single method called GetInterface. This method allows an application to request an interface by specifying its iid (interface identifier). If the component implements the interface, the request returns a pointer that allows the interface’s methods to be called. If the interface is not implemented, GetInterface returns an error. VCSE requires every interface to be extended directly or indirectly from IBase, so GetInterface is always available as a method. This means that an application may use GetInterface to navigate through all the interfaces provided by each component.

VCSE Components

A component provides the implementation of one or more interfaces by supplying the code for their method functions. However, the methods are encapsulated within the component, so their internal working variables and utility procedures cannot be accessed from outside the component. In fact, the only way an application can interact with the component is by calling its interface methods. These constraints help to protect components from misuse and improve their ability to be deployed in different operational contexts.

VCSE allows components the freedom to reuse or leverage other component implementations. However, a component must document its dependencies, so that installation may be managed consistently. The VIDL notation allows the dependencies between components to be recorded without revealing the nature of the interactions between them.

Interfaces make it easy to exchange and upgrade the components installed in an application. If the new version of a component continues to provide the same interfaces, no changes to the application code are required. If the new version provides additional methods in an extension to a previous interface, applications can choose whether to use the extended or original interface. If the new interface is required, the application must be modified accordingly, recompiled, and linked with the component. But if the old interface is still adequate, the application needs only be relinked to the component. Interface extension is a very useful way of providing new functionality while preserving existing interfaces.

Components conform to naming conventions to make them easy to deploy without risk of name clashes with other components already in use.

For more information, see “File Names” on page 5-16.

An application may create one or more instances of components, each with a private set of instance variables. The methods of the component may store and retrieve the values of the instance variables, so that collectively they represent the state of the instance. In the case of the clock component referred to earlier, the state

Похожие материалы

Информация о работе