Metadata

xiaoxiao2021-03-06  66

Metadata is a binary information to describe the program stored in the public language running library to portable executable executable or stored in memory. When you compile your code as a PE file, the metadata is inserted into the file, and the code is converted to the Microsoft Intermediate Language (MSIL) and insert it into the other part of the file. Each type and member of the definition and reference in the module or assembly will be described in the metadata. When the code is executed, the run library loads metadata into memory and references it to discover information about code, members, inheritance and other information.

Metadata describes each type and member defined in the code in a non-specific language. Metadata stores the following information:

Description of the assembly.

Identification (name, version, regional, public key). The type of exported. Other assemblies depend on the assembly. Run the required safety permissions. Type description.

Name, visibility, base class, and implementation interface. Members (methods, fields, properties, events, nested types). Attributes.

Other illustrative elements of modified types and members.

Metadata advantages

For a simpler programming model, metadata is a key, the model no longer requires the interface definition language (IDL) file, header file, or any external component reference method. Metadata allows the .NET language to automatically describe themselves in a non-specific language, and this is not seen by developers and users. In addition, by using attributes, the metadata can be expanded. Metadata has the following main advantages:

Self-description file. The public language runtime module and assembly are described in describing. The metadata of the module contains all information required to interact with another module. Metadata automatically provides the ability of IDL in COM, allowing a file to be used simultaneously to define and implement. Running modules and assemblies do not even need to register with the operating system. As a result, the instructions used by the run library always reflect the actual code in the compilation file, thereby increasing the reliability of the application. Language interoperability and simpler component-based design. Metadata provides all the necessary information about compiled code for inheriting the class from the PE file written in different languages. You can create any class of any class written in any hosted language (any language facing the public language run) without having to worry about explicitly encapsulation or using customized interoperability. Attributes. .NET Framework allows you to declare a particular type of metadata (called properties) in the compilation file. The existence of attributes can be found everywhere in the entire .NET Framework, and the property is used to more accurately control how you work when you work. Alternatively, you can send your own custom metadata to the .NET Framework file through the user-defined custom property. For more information, see Using Properties Extended Metadata.

转载请注明原文地址:https://www.9cbs.com/read-90814.html

New Post(0)