Home > Articles > Programming > .NET and Windows Programming

C# Reflection

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
C# reflection may seem little more than an academic curiosity, with no relevance to programmers. But reflection can be a powerful tool, as enterprise development and networking specialist Stephen B. Morris shows in his review of this interesting technology.

Reflection on Types

Reflection is one of those areas of object-oriented languages that remain a mystery to many programmers, for a number of reasons:

  • The use of reflection is often frowned upon and viewed as being unnecessarily complex. But I can say from experience that reflection is both simple and powerful.
  • Another reason why reflection tends to get a bad name is that its purpose is often misunderstood. The truth is this: Reflection has an important place in this era of loosely coupled software elements.

The true power of reflection lies in its ability to look at the types in a given piece of C# code. Using reflection, you can easily discover the most intimate details about a given C# type—without the need to have compile-time knowledge. In other words, you can discover the necessary details at runtime! This information has important benefits in a variety of programming scenarios.

Now let's make a start at looking into C# reflection techniques.

  • Share ThisShare This
  • Save To Your Account

Discussions

comments powered by Disqus

Related Resources

#TuesdayTrivia: Spotlight on WP7 (Win a copy of Sams Teach Yourself Windows Phone 7 Application Development)
By on May 2, 2012Comments
These days, what CAN'T a smartphone do? Microsoft is putting their own spin on things to help you experience "life in motion" when using your device. Instead of containing static application icons, the re-imagined Start screen features live Tiles showing real-time content updates.

March Trivia #1: Let there be light! (Win Microsoft Visual Studio LightSwitch Unleashed)
By on March 13, 2012Comments
Want a simplified self-service tool to help you build business applications for the desktop and beyond? Microsoft programmers… meet Visual Studio LightSwitch.

February Trivia #2: There's an App for That (Win Sams Teach Yourself iOS 5 Application Development in 24 Hours)
By on February 28, 2012Comments
In less than a decade, the iOS platform has changed the way we think about mobile communication.

See All Related Blogs