Understanding Reflection, Part 1
Subject:   Reflection is great and all... BUT
Date:   2003-10-08 09:16:23
From:   anonymous2
Response to: Reflection is great and all... BUT

C# is great and all... BUT... how do I, a web developer, benefit from it?

I mean, what's the big deal?

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Reflection is great and all... BUT
    2003-10-09 22:10:50 [View]

    Both of these are good questions. As far as reflection and C# goes, anything you can do in C# you can do almost identically in VB.NET. The choice is really just a matter of which syntax you prefer.

    As far as benefits to web developers ...

    Consider this. Using reflection, you can write a function that will take as a parameter an object derived from System.Web.UI.Page and reflect on it to get the Properties associated with the page. This function could loop through these properties and use the set functions to initialize all of the controls on the page by matching the property name to the name of an element in a data source variable. You could also just as easily invoke the get functions in each of these properties to retrieve the data that the user entered. This provides a fairly nice way to implement a flexible method to initialize and retrieve the data on a web page.

    This is only one example of using reflection to benefit web development. Please feel free to share other uses you are making of reflection.
    • Reflection is great and all... BUT
      2003-10-11 09:42:36  anonymous2 [View]

      If you want a real world example, of using reflection in web applications, take a look at this article:

      Also check out the rest of the articles. Great stuff.