.NET Introspection VS Reflection

What is the difference between Introspection and Reflection in .NET.

+4
source share
2 answers

In 2004, an introspection with FxCop was introduced as an alternative to Reflection:

What's new in FxCop 1.30 is that it now performs analysis through a method called Introspection. Using the Introspection engine allows for faster analysis and support for multi-threaded analysis. unlike the Reflection Engine from the previous version, in the Introspection engine the assemblies that you analyze are not blocked, so you do not need to close down FxCop to make a correction and recompile these assemblies. Finally, the Introspection Engine offers a much richer analysis infrastructure than the Reflection engine.

+6
source

They are two parts of the same whole.

Introspection refers to the ability of a class to look "inside" and see, for example, what parameters the method takes, what are the names of its members, etc.

Reflection is a specific name for how .NET implements introspection. Other languages ​​may call it something else (C ++ calls it limited introspective RTTI for runtime type information).

+11
source

Source: https://habr.com/ru/post/1276754/


All Articles