Reflection
-
Hi, I have read about reflections, seems to be a cool thing... but It's seems more oriented to do case tools than other things ? Am I Wrong ? Some people says me that it's used on huge projects... but I think all that thing of calling "Invoke" and things like that remembers me to the IDispatch nightmare and GUIDS and ... :-(
-
Hi, I have read about reflections, seems to be a cool thing... but It's seems more oriented to do case tools than other things ? Am I Wrong ? Some people says me that it's used on huge projects... but I think all that thing of calling "Invoke" and things like that remembers me to the IDispatch nightmare and GUIDS and ... :-(
Reflection is definitely useful for case tools, but it can be used in production code, although the size of the project doesn't matter. For instance, reflection is used by the runtime and XML serialization routines. Reflection could also be used - while not recommended - to get/set a private field in a class if you really need to (its name could be changed at any time, though, which is one reason it's not recommended). You could use reflection to discover type information at runtime, which makes it a good solution in many things like
IDispatch
interfaces, although reflection is much easier to use, IMO, than dispatch (just less things you have to do to accomplish the same thing, which is pretty universal comparing .NET to lower-level languages like C and C++).Microsoft MVP, Visual C# My Articles