. NET Metadata

Source: Internet
Author: User

Label:

Overview

Now, in the. NET development platform plan, its composition compiles: IL code, resource, assembly manifest, and type metadata. We know that the IL code is the code we write. A resource is a picture file. XML file, and other files, only the metadata is not clear (where the assembly manifest is metadata), this blog is mainly about the understanding of metadata.

What is meta data?

What is meta data? We look at the concept of Baidu Encyclopedia, meta-data: Descriptive data, descriptive information about data and information resources, read the definition, give me the feeling is. People do not need to see, can not understand, from this definition I can only say that Chinese language is too profound, anyway just started I did not read. Also see the things of Daniel to understand some, well, I now understand the metadata.

The program we wrote finally compiled the program assembly. Metadata is a description of what we have in this assembly, such as what classes are available, what the class's access level is, and so on, and so on. There are members in this class. And the properties of these member types, access levels, and so on. Of course, it also describes the relationship between assembly assemblies, as to why these things, this is the role of metadata.

the role of meta data

Above we know what the meta data is, this module. What we're talking about is the role of meta data. You want to know what the metadata does. We just need to know. Why, with it, we all know that the emergence of a new thing, and the ability to rise at a high speed is the condition that it overcomes the bad phenomena that existed at that time. So, what is that bad phenomenon?

One problem with Microsoft's lack of metadata technology is that the binary code reuse is very cumbersome. The reuse of binary at that time was achieved through COM technology, namely. We write a COM component and then compile good content for others to use. Others cannot be used very well. Why is it? When someone else calls the contents of your COM component again. Is hard-coded, hard-coded is no no intelligent hints, called methods do not know is not the method in the COM component, do not know that the written error is not, want to know must perform talent know. And we know that the method inside the COM component is known through the COM operation manual, but how inconvenient it was to be.

For the advent of COM technology, is also very strong, why do you think he is bad? Because before it, we almost could not write a let us rest assured that the library, why say so? Because before COM appears. Our program only can call the source code directly, if we write a library, we want to let others use. Then you have to give someone your source code, and then. After the completion of the program, the unified generation compiled build. You want, you write something. Not yet how to give all the source code to others, then someone else is equivalent to have all.

it says a whole process of metadata generation. Its main function is to solve the reuse of binary code.

use of meta data

I believe you know that the meta data can be used directly by the VS integrated development environment. and is very common, such as: we add a reference to an assembly. can be directly and conveniently used, it is simply the use of assembly metadata, then the metadata is only this? Of course not, the fact that the metadata is also used by our programmers, one way to use it is reflection, the reflection technology is the use of metadata to achieve, we through the reflection of the technology. The ability to obtain information about the assembly and to obtain information about the class and the inside of the class. Ability to create an object. The ability to invoke methods and so on.

In addition to the system to help us generate some metadata, when we are programming, we can also give classes, methods, properties and so on to add some metadata, this is the production of features, features are higher level of abstraction.

Summary

. NET metadata is not its origin, but rather a reference to Java.. NET and Java are a lot of things that the project draws on. Metadata is not a. NET excess burden, but. NET to a higher level of coaching.

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

. NET Metadata

Related Article

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.

Tags Index: