| Article: |
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?
|
||
Showing messages 1 through 2 of 2.
-
Reflection is great and all... BUT
2003-10-09 22:10:50 neh123us@yahoo.com [Reply | View]
-
Reflection is great and all... BUT
2003-10-11 09:42:36 anonymous2 [Reply | View]
If you want a real world example, of using reflection in web applications, take a look at this article: http://www.west-wind.com/presentations/aspnetdatabinding/aspnetdatabinding.asp
Also check out the rest of the articles. Great stuff.




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.