|
-
Feb 17th, 2005, 02:45 AM
#1
reflection question [resolved]
hi,
what is reflection???
i have heard a lot about it, but have no idea what it actually is.
Last edited by tr333; Feb 17th, 2005 at 11:04 PM.
-
Feb 17th, 2005, 02:59 AM
#2
-
Feb 17th, 2005, 03:05 AM
#3
Re: reflection question
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
-
Feb 17th, 2005, 04:10 AM
#4
"The dark side clouds everything. Impossible to see the future is."
-
Feb 17th, 2005, 05:20 AM
#5
Re: reflection question
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.
-
Feb 17th, 2005, 05:24 AM
#6
Re: reflection question
i understand some of the things that can be done using reflection, but i still dont fully understand the definition of reflection.
from MSDN:
provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types
can someone please explain this statement in words that are easy to understand for someone new to .NET
-
Feb 17th, 2005, 06:06 AM
#7
Re: reflection question
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.
-
Feb 17th, 2005, 06:09 AM
#8
Re: reflection question
whats invoking a method mean?
-
Feb 17th, 2005, 06:32 AM
#9
-
Feb 17th, 2005, 06:34 AM
#10
Re: reflection question
is a method just another name for a function/subroutine?
-
Feb 17th, 2005, 06:35 AM
#11
"The dark side clouds everything. Impossible to see the future is."
-
Feb 17th, 2005, 07:37 AM
#12
Re: reflection question
so i guess reflection is just a way to control other objects/methods and their properties
-
Feb 17th, 2005, 09:23 AM
#13
Re: reflection question
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
-
Feb 17th, 2005, 10:48 AM
#14
PowerPoster
Re: reflection question
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.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Feb 17th, 2005, 11:03 PM
#15
Re: reflection question
thanks for the help on this...
nothing mission critical, but its nice to know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|