The need to preserve metadata about types has been known for a number of years , and a variety of component architectures already provide solutions to this problem. COM and CORBA, for example, allow developers to describe their components' interfaces in an IDL. IDL files serve as the public interface to the components they describe. The IDL syntax of both COM and CORBA is based on C/C++. The compilation of IDL files produces binary descriptions of the metadata described by the IDL files. In CORBA, this description is known as an interface repository; in COM, it is known as a type library. A number of limitations arise with the use of IDL files.
Another approach is to have the language compiler generate the type's metadata directly when compiling the source files, rather than during a separate IDL compilation. In this case, the language compiler can also embed the metadata directly into the implementation file for the type, which is similar to how a type library can be embedded as a resource. This method does not permit a type's metadata to exist with the definition of the type, and vice versa. It also prohibits incompatibility between a type and its metadata description. The CLR uses this technique to manage metadata. |