Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reflection Help

Reflection Help

Scheduled Pinned Locked Moved C#
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lavanya_satheesh
    wrote on last edited by
    #1

    hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:

    E N P 3 Replies Last reply
    0
    • L lavanya_satheesh

      hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:

      E Offline
      E Offline
      engsrini
      wrote on last edited by
      #2

      It will be used when you want to -load an assembly - iterate the methods in assembly - Call the methods etc. @ runtime Say for eg in my project i will get the method and assembly name in an xml, So my exe will read the XML file and has to execute the method, My Project: Test engine - it will get teststeps(method names) in an xml file from a server and will execute in the client machine Hope you got atleast one real world application example

      1 Reply Last reply
      0
      • L lavanya_satheesh

        hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:

        N Offline
        N Offline
        Nader Elshehabi
        wrote on last edited by
        #3

        Beside what engsrini alrready said, you can think of it as an advanced way of dynamic coding. Currently it isn't widely used, but I believe in the future it may. One example is like making your own forms editor. Something like MS Access where your users can make a form and bind it to the Db. Maybe you want to add custom controls in your form. Another example is using reflection as a mean of adding update capability in your program, where you dunamically instantiate a class from a dll and call certain methods. When you update all you need to do is to replace that dll. I know this is crap but it is possible. One last thing is to use reflection to reference to a library that is not included in your program by default -for example optional downloadable plug-ins to your program-, and make error checking when using the classes in it. So that users can un/install plug-ins as suits them without changing anything in the main program. If a plug-in makes an error or was deleted by mistake, using reflection and not hardcoding the references into your program will give you flexibility and prevent your program from crashing. That was some of the things I could come up with in 5 minutes. Creativity has no limits.:)

        Regards:rose:

        1 Reply Last reply
        0
        • L lavanya_satheesh

          hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Lavanya We have a business rules engine which allows us to bind in custom objects at run time. How this works is the customer develop a custom object that implements an interface called IBindingObject. The rules engine loads the object (using reflection), and verifies that it does indeed implement IBindingObject. We then use reflection to call other methods to find out and use the rule capabilities of the custom object. HTH

          Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world." Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that." Deja View - the feeling that you've seen this post before.

          L 1 Reply Last reply
          0
          • P Pete OHanlon

            Lavanya We have a business rules engine which allows us to bind in custom objects at run time. How this works is the customer develop a custom object that implements an interface called IBindingObject. The rules engine loads the object (using reflection), and verifies that it does indeed implement IBindingObject. We then use reflection to call other methods to find out and use the rule capabilities of the custom object. HTH

            Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world." Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that." Deja View - the feeling that you've seen this post before.

            L Offline
            L Offline
            lavanya_satheesh
            wrote on last edited by
            #5

            Thanks guys. I am very new to this concept of reflection. and when i read abt it i was wondering how this could be used in real time apps. that is y i posted the msg. i got some idea now. thanks a lot.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups