473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Alternatives to InvokeMethod

I've created a component that takes a class as an input
and executes methods on the class based on a set of text
instructions. The instructions are the names of the
methods to be executed and are different for each class
passed in. I've been using InvokeMethod to do this and it
works, but, it's TOO slow.

I've used the "eval" method in Jscript to do this sort of
thing and it doesn't seem to be as slow.

I'm about to try dynamic compilation but it seems quite a
bit more work (and is more likely to develop bugs).

I'd appreciate any ideas to solve this problem.

Thanks
R
Nov 20 '05 #1
4 1512
"Ringo" <an*******@discussions.microsoft.com> schrieb
I've created a component that takes a class as an input
and executes methods on the class based on a set of text
instructions. The instructions are the names of the
methods to be executed and are different for each class
passed in. I've been using InvokeMethod to do this and it
works, but, it's TOO slow.

I've used the "eval" method in Jscript to do this sort of
thing and it doesn't seem to be as slow.

I'm about to try dynamic compilation but it seems quite a
bit more work (and is more likely to develop bugs).

I'd appreciate any ideas to solve this problem.

If possible, the component, or the library containing the component, can
define an interface that must be implemented in the class passed to the
component. This requires select case blocks within the component to call the
appropriate method depending on the instructions, but I think it should be
faster than reflection.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
"Ringo" <an*******@discussions.microsoft.com> schrieb
I've created a component that takes a class as an input
and executes methods on the class based on a set of text
instructions. The instructions are the names of the
methods to be executed and are different for each class
passed in. I've been using InvokeMethod to do this and it
works, but, it's TOO slow.

I've used the "eval" method in Jscript to do this sort of
thing and it doesn't seem to be as slow.

I'm about to try dynamic compilation but it seems quite a
bit more work (and is more likely to develop bugs).

I'd appreciate any ideas to solve this problem.

If possible, the component, or the library containing the component, can
define an interface that must be implemented in the class passed to the
component. This requires select case blocks within the component to call the
appropriate method depending on the instructions, but I think it should be
faster than reflection.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thanks, Armin

unfortunately, the objects can have any method name and
the component will only know which methods to call from a
text file. I can't recompile this component to add new
interfaces and the objects being passed to it will always
have there own set of methods.
-----Original Message-----
"Ringo" <an*******@discussions.microsoft.com> schrieb
I've created a component that takes a class as an input
and executes methods on the class based on a set of text instructions. The instructions are the names of the
methods to be executed and are different for each class
passed in. I've been using InvokeMethod to do this and it works, but, it's TOO slow.

I've used the "eval" method in Jscript to do this sort of thing and it doesn't seem to be as slow.

I'm about to try dynamic compilation but it seems quite a bit more work (and is more likely to develop bugs).

I'd appreciate any ideas to solve this problem.

If possible, the component, or the library containing

the component, candefine an interface that must be implemented in the class passed to thecomponent. This requires select case blocks within the component to call theappropriate method depending on the instructions, but I think it should befaster than reflection.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

.

Nov 20 '05 #4
Thanks, Armin

unfortunately, the objects can have any method name and
the component will only know which methods to call from a
text file. I can't recompile this component to add new
interfaces and the objects being passed to it will always
have there own set of methods.
-----Original Message-----
"Ringo" <an*******@discussions.microsoft.com> schrieb
I've created a component that takes a class as an input
and executes methods on the class based on a set of text instructions. The instructions are the names of the
methods to be executed and are different for each class
passed in. I've been using InvokeMethod to do this and it works, but, it's TOO slow.

I've used the "eval" method in Jscript to do this sort of thing and it doesn't seem to be as slow.

I'm about to try dynamic compilation but it seems quite a bit more work (and is more likely to develop bugs).

I'd appreciate any ideas to solve this problem.

If possible, the component, or the library containing

the component, candefine an interface that must be implemented in the class passed to thecomponent. This requires select case blocks within the component to call theappropriate method depending on the instructions, but I think it should befaster than reflection.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

.

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Scott F | last post by:
testvar = bob # Trial A: This does not work if testvar == ("fred" or "bob): statements # Trial B: This does work if textvar == "fred" or textvar == "bob": statements
1
by: tascien | last post by:
I think invoke method is good. but it is not 'great'... I need a way to invoke the class... ex: t = getType(myClass) t.InvokeMethod(....) That is if i don't know the method, but I know the...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
2
by: julien | last post by:
Hello, I have an assembly with a static variable: private static readonly ILog log4net = LogManager.GetLogger(typeof(Core)); In one of the methods, I use this variable: private void myMethod()...
0
by: Ringo | last post by:
I've created a component that takes a class as an input and executes methods on the class based on a set of text instructions. The instructions are the names of the methods to be executed and are...
6
by: Sameh Ahmed | last post by:
Hello there Anybody used Managementobject.invoke method? if yes how do u send method parameters? Thanks in advance Regards Sameh
0
by: Jan | last post by:
I just started using .NET Remoting. I have a test system (client) which connects to our device (server) running XP Embedded. When my server object is called it uses a library where reflection...
1
by: Spencer | last post by:
Our Mainframe DBA insists that the IDTHTOIN parameter be set to 600 so that all idle threads timeout after 10 minutes. This is causing a particular packaged application that expects to hold idle...
3
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I've used an Application_BeginRequest function in my global.asax page to implement some URL rewriting functionality on our website. However, upon moving it to my host (1&1.co.uk), it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.