hi
I am not clear about reflection apis uses.
what is the pass method?
can you give me a very basic example
thnx
Eddie said:
Something I use it for is for "Addin" type support for applications..
The current project I am working on is a smart client application, which
has pre-defined interfaces for addin modules.
The application has a config file which specifies an assembly name that
contains addin modules. Using reflection it is easy to examine the
essemblies, find addins (types that support set interfaces) and then
instantiate them, all while maintaining type safety..
Another useful function is for the basic datatypes (int, double, datetime
etc).. They all have a pass method. Unfortunatly the pass method is not
defined on an interfce or anything else like that, so using reflection, you
can check a data type to see if it supports the parse method, and if it does
you can then invoke it. Once again, this method allows you to retain type
safety..
There are hunders of other uses including self desribing business objects,
where properties have attibutes defining min/max value, required flags etc.
Using reflection you can create "smart" controls that examine these
attributes and automatically enforce the rules. It really helps to cut down
on the amount of basic UI validation required.
These are just some of the things I have used reflection for. I'm sure
there are hundreds of other really nice uses..