Reflection: How to Go About Examining Assemblies

Reflection: How to Go About Examining Assemblies

As you know by now, assemblies provide the infrastructure that allows the common language runtime to understand the contents of an application and to enforce the versioning and dependency rules defined by the application. Assemblies contain modules, and modules contain types. Each type contains members.

The .NET Framework includes classes, known as reflection classes, that provide objects that encapsulate assemblies, modules, and types. By using System.Reflection classes, we can spy on the internals of an assembly.

Reflection is a means to find out about objects at run time. The implementation of reflection in Visual Basic .NET is similar to how reflection is implemented in the Java language and, to a larger extent, Runtime Type Information (RTTI) in C++. The Reflection namespace contains more than 130 classes and interfaces that provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types. Reflection can be a complex topic, but I'll cover the important highlights by demonstrating a program that examines all the members of an assembly.



Coding Techniques for Microsoft Visual Basic. NET
Coding Techniques for Microsoft Visual Basic .NET
ISBN: 0735612544
EAN: 2147483647
Year: 2002
Pages: 123
Authors: John Connell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net