What is reflection, DOT NET Programming

Assignment Help:

Reflection

All .NET assemblies have metadata information stored  the types defined in the modules. And This metadata information can be accessed by mechanism called as "Reflection". The System.Reflection is used to browse through the metadata information.

By Using the reflection we can also dynamically invoke methods using the System.The Type.InvokeMember. Below is the sample source code if needed we can also get this code from the CD provided, go to the  "Source code" folder in the "Reflection Sample" folder.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Pobjtype As Type
    Dim PobjObject As Object
    Dim PobjButtons As New Windows.Forms.Button()
    Pobjtype = PobjButtons.GetType()
For Each PobjObject In Pobjtype.GetMembers
LstDisplay.Items.Add(PobjObject.ToString())
Next
End Sub
End Class

1506_reflection display.jpg


Sample source code uses reflection to browse through "Button" class of "Windows.Forms". If we compile & run the program following is the output as shown in "Sample Reflection Display". By Using the reflection we can also dynamically invoke a method using "System.Type.Invoke Member".

 


Related Discussions:- What is reflection

Sequence in which asp.net events are processed, What' is the sequence in wh...

What' is the sequence in which ASP.NET events are processed? The sequence in which the ASP.NET events occur are as folows :- 1.     Page_Init. 2.     Page_Load. 3.

Explain custom activities, Explain Custom Activities. In addition to th...

Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

Nested classes, What is nested Classes? You can access an array using t...

What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

What is language integrated query, What is Language Integrated Query (LINQ)...

What is Language Integrated Query (LINQ)? LINQ is a programming model that is the composition of general-purpose standard query operators that permit you to work with data, reg

Learning management system, I am looking for learning management software (...

I am looking for learning management software (LMS) preferably in ASP.NET and Microsoft SQL/ MYSQL server as the database. The broad scope of the system could be 1. User managem

Difference between panel and group box classes, Difference between Panel an...

Difference between Panel and Group Box classes? Panel & Group box both can used as container for other controls like radio buttons & check box. the difference in panel & group

What are the differences between ajax and javascript, What are the differen...

What are the differences between AJAX and JavaScript? The differences among AJAX and JavaScript are given as follows: AJAX sends request to the server and does not wait for

Object oriented programming, What is Object Oriented Programming? This ...

What is Object Oriented Programming? This is a problem solving process to develop software systems. This is a technique to think real world in terms of objects. The Object maps

Describe the role that xsl, Describe the role that XSL can play while dynam...

Describe the role that XSL can play while dynamically generating HTML pages from a relational database. The SQLXML 3.0 and advanced versions give the facility of mapping the SQ

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd