what can i use it for.
I just want to create some samples of reflection.
I have created a utility.
i have a class and some methods have an attribute called "Storedprocedure"
which takes as a parameter the stored procedure name .
i then use reflection to find out those methods that have these attributes.
and check if the db has those stored procedures or someone has accidently
deleted them.
this is quite useful. but i cant think of any other ways that i can use
reflection.
what do u mean by default serialization of objects?
and how about the databinding of classes to display objects ?
can u elaborate a bit more thanx?
Then use reflection to load those assemblies at run-time, and call the
PerformSomeAction() method on the classes, passing Console.Out or
something along those lines.
One of the things I have used reflection for was to create a better Comparer. The comparer I created alows me to sort my own custom collection based on a string array of fields. Works really well
Another thing I use reflection for is for Generic validation. Most of my business objects have custom attributes such as "Required", Min/Max Values etc that are retrieved by reflection from an Extender control. This allows me to bind business objects directly to the UI and still define these requirements in a single central location.
These are just some of the places I use reflection almost every day.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.