Reflection manual Notes 1. flexible programming methods

Source: Internet
Author: User
1. Definition of reflection:
Reflection is a mechanism to dynamically analyze, manipulate, and create objects at runtime. -- The three functions are analyzed in the following sections.
Reflection needs to access the metadata stored in the. NET assembly to discover information about the original code.

2. The later binding of reflection is different from the later binding in C.
In C #, the override method is used for post-binding-the method used during compilation.
Reflection does not have this restriction and will not be determined until it is running. Reflection can also bind datasets and types to achieve dynamic binding Based on metadata.

3. type security: indicates that the object can ensure that the operation of this type of instance is not allowed and will not be imposed on this type of instance-do not do things that shouldn't be done.

4. The static method is bound early (static)-it cannot be inherited.
The instance methods that can be inherited are bound at run time, And the instance methods that cannot be inherited (sealed) are early bound (static.

5. Two methods to access metadata:
Enter metadata from the bottom: The specific object type-the Assembly containing the object
Go to metadata from the top: Get the metadata directly from the Assembly.

6. Relationship between metadata:

Here, the Assembly refers to assebmly, including the version, reference to other assembly, and resource files.
The module is a DLL or EXE file. An assembly can contain multiple modules.
 

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.