Prototype Components

Every component inherits properties, resources, dependencies, and build scripts from another component known as its prototype component. The prototype component is specified during component creation. Any component can be specified as the prototype for another component, except in the case of a circular relationship in which two components declare each other as prototypes.

If a prototype is not specified, then the platform default prototype component is used. The platform default prototype component provides script that defines the default build behavior for all components authored against the platform.

Because each component has a prototype, a prototype may in turn have its own prototype. This creates a prototype chain. The platform default prototype component is always at the base of a prototype chain.

The following diagram illustrates prototype inheritance.


In this diagram, P represents the platform default prototype component from which all components are ultimately derived. The number of intermediate prototypes in a chain, shown here as P1 and P2, can be any number including zero. C represents a component whose prototype component is P2.When a component is added to a configuration, its properties, resources, dependencies, and build script are merged with those of its prototype and all prototypes in the chain. Any conflicts are resolved by allowing the definition of the component to override the definition of the prototypes.

One example of a prototype component is the Selector Prototype Component. This is included in the component database and is intended for use in macro components. When a macro component uses this component as its prototype, the components upon which the macro component is dependent are displayed in Target Designer, in the macro component's settings. These components are displayed with checkboxes, and if a user clears the checkboxes for any of them before the first dependency check is run, they are excluded from the configuration.

See Also

Component Types | Components | Macro Components | Configurations | Platforms

Last updated on Wednesday, October 18, 2006

© 2006 Microsoft Corporation. All rights reserved.