What is metadata ??

Source: Internet
Author: User

Although Microsoft explained the following, it still does not understand. (Today, I started a new project and used nunit tools for unit testing. The nunit help puts forward the concept of metadata, which I just don't understand. I do not understand it after reading msdn)

Bytes -----------------------------------------------------------------------------------------------------

Metadata is a binary information used to transplant executable files (PE) files or store them in the memory.Program. Add yourCodeCompile as PE
The metadata is inserted into a part of the file, and the code is converted to Microsoft intermediate language (msil)
And insert it into another part of the file. Each type and member defined and referenced in a module or assembly is described in metadata. When the code is executed, the Runtime Library loads the metadata into the memory and
It is used to discover information about code, such as classes, members, and inheritance.

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

    • Assembly description.

      • Identifier (name, version, region, and public key ).
      • Export type.
      • Other Assembly on which the Assembly depends.
      • Security permissions required for running.
    • Type description.
      • Name, visibility, base class, and implemented interface.
      • Member (method, field, attribute, event, nested type ).
    • Attribute.
      • Modifier types and other descriptive elements of members.
Advantages of metadata

For a simpler programming model, metadata is the key. This model no longer requires an Interface Definition Language (IDL) file, header file, or any external component reference method. Metadata allowed
. Net
The language automatically describes itself in a non-specific language, which is invisible to developers and users. In addition, you can use attributes to expand the metadata. Metadata has the following advantages:

    • User description file.

      The modules and assembly of the Common Language Runtime Library are self-described. The metadata of a module contains all the information required for interaction with another module. Metadata automatically provides IDL in COM
      Allows a file to be defined and implemented at the same time. The runtime module and Assembly do not even need to be registered with the operating system. As a result, the instructions used by the running database always reflect the actual code in the compiled file.
      High application reliability.

    • Language interoperability and simpler component-based design.

      Metadata provides all required information about compiled code for you to inherit classes from PE files written in different languages. You can create instances of any class written in any hosting language (any language for the public language runtime) without worrying about explicit blocking or using custom mutual code.

    • Attribute.

      . NET framework allows you to declare a specific type of metadata (called attributes) in the compilation file ). In the entire. NET Framework
      Properties can be found everywhere. properties are used to more accurately control how your program works during running. In addition, you can use custom attributes
      File to send your own custom metadata.

---------------- 2005-9-22 -----------------
The following describes the attributes concept in codeproject, but does not understand the relationship between attributes and metadata? Now I will study ......

Attributes are a new kind of declarative information. We can use
Attributes to define both design-level information (such as help file,
URL for documentation) and run-time information (such as associating
XML field with class field). We can also create "self-describing"
Components using attributes.

Msdn defines attributes more easily:
An attribute is a piece of additional declarative information that is
Specified for a declaration.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.