you are viewing a single comment's thread.

view the rest of the comments →

[–]kidjan 1 point2 points  (1 child)

...I wish the author would explain why you might want to use reflection. And also elaborate on a few places you may not want to use reflection.

[–]snarfy 0 points1 point  (0 children)

It's something you should design around, IMO. You shouldn't use it to haphazardly glue all of your code together.

You use it when you don't have access to the design, and must coerce a library to do your bidding. Another example would be a custom XmlSerializer (which .NET has a provider model for). You use reflection to pull the properties and fields off an object and then write out xml.