Reflection Help
-
hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:
-
hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:
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
-
hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:
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:
-
hi all, can anyone tell me where reflection finds its use in a real time system? thanks in advance, lavanya:rose:
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.
-
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.
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.