Important: The information in this document is obsolete and should not be used for new development.
Introduction to Components
A component is a piece of code that provides a defined set of services to one or more clients. Applications, system extensions, as well as other components can use the services of a component. A component typically provides a specific type of service to its clients. For example, a component might provide image compression or image decompression capabilities; an application could call such a component, providing the image to compress, and the component could perform the desired operation and return the compressed image to the application.Multiple components can provide the same type of service. For example, separate components might exist that can compress an image by 20 percent, 40 percent, or 50 percent, with varying degrees of fidelity. All components of the same type must support the same basic interface. This allows your application to use the same interface for any given type of component and get the same type of service, yet allows your application to obtain different levels of service.
The Component Manager provides access to components and manages them by, for example, keeping track of the currently available components and routing requests to the appropriate component.
The Component Manager classifies components by three main criteria: the type of service provided, the level of service provided, and the component manufacturer. The Component Manager uses a component type to identify the type of service provided by a component. Like resource types, a component type is a sequence of four characters. All components of the same component type provide the same type of services and support a common application interface. For example, all image compressor components have a component type of
'imco'
. Other types of components include video digitizers, timing sources, movie controllers, and sequence capturers.
The Component Manager allows components to identify variations on the basic interface they must support by specifying a four-character component subtype. The value of the component subtype is meaningful only in the context of a given component type. For example, image compressor components use the component subtype to specify the compression algorithm supported by the component.
- Note
- Component types consisting of only lowercase characters are reserved for definition by Apple. You can define component types using other combinations of characters, but you must register any new component types with Apple's Component Registry Group (AppleLink REGISTRY).
All components of a given type-subtype combination must support a common application interface. However, components that share a type-subtype specification may support routines that are not part of the basic interface defined for their type. In this manner, components can provide enhanced services to client applications while still supporting the basic application interface.
Finally, the Component Manager allows components to have a four-character manufacturer code that identifies the manufacturer of the component. You must register your component with Apple's Component Registry Group to receive a manufacturer code for your component. The manufacturer code allows applications to further distinguish between components of the same type-subtype.