Component Manager
Encyclopedia
In Apple Macintosh computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

, Component Manager was one of many approaches to sharing code that originated on the pre-PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

 Macintosh. It was originally introduced as part of QuickTime
QuickTime
QuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...

, which remained the part of Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

 that used it most heavily.

Technical details

A component was a piece of code that provided various functions that may be invoked by clients. Each function was identified by a signed 16-bit integer ID code. Non-positive codes were reserved for predefined functions that should be understood by all components—open/close a component instance, query whether a function was supported, etc. The meanings of positive function codes depended on the type of component.

A component instance was created by opening a component. This called the component's open function to allocate and initialize any necessary storage for the instance. Closing the instance got rid of this storage and invalidated all references to that instance.

Components and component instances were referenced by 32-bit values that were not pointers. Instead, they were interpreted as keys into internal Component Manager tables. These references were generated in such a way that, once they became invalid, those values were unlikely to become valid again for a long time. This minimized the chance of obscure bugs due to dangling references.

Components were identified by OSType
OSType
OSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...

 codes giving their type, subtype and "manufacturer". For instance, a component type might be "raster image compressor", subtypes of which might exist for JPEG, H.261, Sorenson, and Intel Indeo, among others. It was possible to have multiple components registered with exactly the same identification codes, giving alternative implementations of the same algorithm for example using hardware versus software, trading off speed versus quality, or other criteria. It was possible for the applications to query the existence of such alternatives and make explicit choices between them, or let the system choose a default.

Among the options available, a component could delegate parts of its functions to another component as a form of subclassing for code reuse. It was also possible for one component to capture another, which meant that all accesses to the captured component had to go through the capturing one.

Mac OS Components

Mac OS accumulated a great variety of component types:
  • Within QuickTime
    QuickTime
    QuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...

    , there were image codecs, media handlers, media data handlers, video digitizer drivers, file format importers and exporters, and many others.
  • The Sound Manager moved to a predominantly component-based architecture in version 3.0: sound output devices were represented as components, and there were also component types for mixing multiple channels, converting between different sample rates and sample sizes, and encoding and decoding compressed formats.
  • AppleScript
    AppleScript
    AppleScript is a scripting language created by Apple Inc. and built into Macintosh operating systems since System 7. The term "AppleScript" may refer to the scripting system itself, or to particular scripts that are written in the AppleScript language....

     introduced the concept of scripting languages implemented as components.
  • ColorSync
    ColorSync
    ColorSync is Apple Inc's color management API for the Mac OS and Mac OS X.-Version history:Apple developed the original 1.0 version of ColorSync as a Mac-only architecture, which made it into an operating system release in 1993. In the same year, Apple co-founded the International Color Consortium...

     implemented different colour-matching methods as components.
  • QuickDraw GX
    QuickDraw GX
    QuickDraw GX was a replacement for the QuickDraw 2D graphics engine and Printing Manager inside the "classic" Mac OS. Its underlying drawing platform was a resolution-independent object oriented retained mode system, making it much easier for programmers to perform common tasks...

    "font scalers" were renderers for the different font formats.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK