7.1 Reflection

only for RuBoard

Assemblies (either an .exe or a .dll ) can contain one or more modules, though they usually contain just one. In turn , these modules contain one or more types; types in .NET include classes, interfaces, arrays, structures, delegates, and enumerations. Types contain members : fields, methods , properties, events, and parameters. The .NET class library supplies objects that encapsulate all these entities, letting you load an assembly at runtime (over the network, if you need to) and inspect all types in that assembly. Using the introspective properties of these objects, you can determine if a class is abstract, a method is public, or how many class constructors are available. In fact, anything you can describe with VB.NET code can be discovered at runtime. This process is called reflection .

Reflection is one of the .NET Framework's core technologies. In addition to runtime type discovery, you can use it to create assemblies, modules, and types at runtime and persist them to disk as .exe or .dll files. JScript .NET uses reflection to build symbol tables. The .NET Framework SDK, in fact, contains C# source code for two compilers that are written using reflection: a LISP compiler and a compiler for a subset of C called MyC. Serialization and remoting, both major players in .NET, also rely heavily on reflection.

only for RuBoard


Object-Oriented Programming with Visual Basic. Net
Object-Oriented Programming with Visual Basic .NET
ISBN: 0596001460
EAN: 2147483647
Year: 2001
Pages: 112
Authors: J.P. Hamilton

Similar book on Amazon

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