14.3 Runtime Support
At runtime the core CLR services, such
as serialization and remoting,
inspect the custom and pseudocustom attributes to determine how to
handle an instance of a type.
In the case of custom attributes, this is done by creating an
instance of the attribute (invoking the relevant constructor call and
property-set operations), then performing whatever steps are needed
to determine how to handle an instance of the type.
In the case of pseudocustom attributes, this is done by inspecting
the metadata directly and determining how to handle an instance of
the type. Consequently, handling pseudocustom attributes is more
efficient than handling custom attributes.
Note that none of these steps is initiated until a service or user
program actually tries to access the attributes, so there is little
runtime overhead unless required.
|