Sunday, June 30, 2013

What is reflection?

Tags

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).

16 comments

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!

C84A4B29AFSantiago8212865D7F delete December 30, 2024 at 2:45 PM

Warning!! SPAM has been detected!

133A7204C6Sasha41B8AD6040 delete January 1, 2025 at 6:48 PM

Warning!! SPAM has been detected!

26DDE369BFMicah0115B6C438 delete January 2, 2025 at 12:10 AM

Warning!! SPAM has been detected!

Warning!! SPAM has been detected!


EmoticonEmoticon

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:o
:>)
(o)
:p
:-?
(p)
:-s
8-)
:-t
:-b
b-(
(y)
x-)
(h)