Introduction

Reflection is one of the most powerful concepts in Visual Basic .NET. It is definitely one of my favorite topics. Programmers at any level might reasonably ask, "What is Reflection?" Reflection is the ability to dynamically discover type information. More than that, Reflection helps programmers apply that information to use types dynamically. Generally, when we say dynamically we mean that we can do something at runtime that we didn't know about at design time.

Reflection technology supports things like late binding (which comes from COM), and it allows your code to interact with code that your code had no prior knowledge about. Reflection literally supports loading an assembly, dynamically discovering information about types and their members, and invoking operations on those types and members .

By themselves the cool capabilities I described above represent a logical evolution of static Run Time Type Information (RTTI). Reflection supports more advanced behavior, too. A programmer can use Reflection to dynamically create new types at runtime and then invoke operations on those types. (This sounds a bit like science fiction . Imagine, a smart application is learning and writing its own object-oriented code as it learns.)

Everything that can and will be done with Reflection hasn't been discovered yet, but there will be evocative applications for Reflection. Some great ones exist. The best ones are yet to be discovered . We'll explore Reflection in detail in this chapter.



Visual Basic. NET Power Coding
Visual Basic(R) .NET Power Coding
ISBN: 0672324075
EAN: 2147483647
Year: 2005
Pages: 215
Authors: Paul Kimmel

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