hi,
what is reflection???
i have heard a lot about it, but have no idea what it actually is.
Printable View
hi,
what is reflection???
i have heard a lot about it, but have no idea what it actually is.
i have read that before but i dont understand most of it.
too technical and not enough plain english...
not good for people new to .net
Hi
There are 2 samples reflexion in the vb.net codebank forum.
http://www.vbforums.com/showthread.php?t=306850 http://www.vbforums.com/showthread.php?t=310409
Regards
Jorge
Given a .NET assembly, you can use Reflection to access various methods, events, properties, etc. in it.
There may be times where you need to use it. Recently, I was working on a testbed application tester which would be passed a .net assembly. I would run through it's methods, invoke them and get the results, comparing it with an existing 'result' file.
Never finished it, but without reflection it wouldn't have been possible.
i understand some of the things that can be done using reflection, but i still dont fully understand the definition of reflection.
from MSDN:
can someone please explain this statement in words that are easy to understand for someone new to .NETQuote:
provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types
It means:
If you look at my example in the link above, the Reflection namespace allows me to iterate through the objects and properties, etc. of the class. Also, I could use the InvokeMethod() object and pass it a name, it would invoke that method.
whats invoking a method mean?
Calling a method.
is a method just another name for a function/subroutine?
correct
so i guess reflection is just a way to control other objects/methods and their properties
It can be used for that. You can also create new instances of forms in other assemblies, for example.
Here's another example of usage:
http://msdn.microsoft.com/msdnmag/is...n/default.aspx
Hi,
As I understand it, you can use Reflection to refer to objects, methods etc using a string, which can be provided by the user as well as in design view, rather than hardcoding in the actual name. You can do this in other ways as well, to a certain extent, e.g. CallByName or Arrays of objects, but Reflection provides a more flexible approach.
CallByName and Arrays are easier to learn.
thanks for the help on this...
nothing mission critical, but its nice to know.