Tuesday, October 10, 2006

Reflection到底是个啥东西?

@ Code in the CLR is packaged in an assembly. Even though it is often thought of as a file, an assembly is actually a logical container for different parts of the data the CLR needs to execute code.

@ These parts of data of an assembly include: Assembly metadata, Type metadata, Intermediate Language code, and Resources.

@ Assembly Metadata includes data that defined the assembly, such as the name, version, strong name, and culture information. Assembly metadata is also called manifest.

@ Type Metadata is the information describes what a type looks like, including the namespace, class name, members (methods, properties, constructors, etc.), and parameters.

@ Most of the time, all these parts of an assembly are compiled into a single file.

@ Assemblies are containers for modules, and modules are containers for types.

^ 我啥时候会用的上Reflection呀?

e C-sharp reflection: Save development time throughout the project life-cycle