Prabhu Raja
What is reflection?
Posted by Prabhu Raja in .Net | ASP.NET on Oct 29, 2011
0
Do you know the answer for this question? Post it below.
Guest

Reflection - The process of getting the metadata from modules/assemblies. When .NET code is compiled, metadata about the types defined in the modules is produced. These modules are in turn packaged as assemblied. The process of accessing this metadata in called Reflection.

The namespace System.Reflection contains classes that can be used for interrogating the types for a module/assembly. We use reflection for examining data type sizes for marshalling across process & machine boundaries.

Reflection is also used for:

1) To dynamically invoke methods (using System.Type.InvokeMember)
2) To dynamically create types at runtime (using System.Reflection.Emit.TypeBuilder).

Posted by Hemant Kumar on Nov 01, 2011

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.

Using reflection to access .NET metadata is very similar to using
ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. determining data type sizes for marshaling data across context/process/machine boundaries.

Reflection can also be used to dynamically invoke methods (see
System.Type.InvokeMember), or even create types dynamically at run-time (see System.Reflection.Emit.TypeBuilder).

Posted by Prabhu Raja on Oct 29, 2011
Sponsored by
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
Sponsored by
Team Foundation Server Hosting
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.