开发者

How do I send code ( a class in this case) to a server/program and receive output

Here is the situation:

I have a huge data set that I need quick access to. It's a financial data set so basically the way it's set up is that at each point in time, you have data for thousands of stocks. Now, loading this data into the program takes a while (20-40 seconds) and I would like to avoid having to do this every time I make changes in the code.

Basically, I had an idea and I want to know if it makes sense / if it is optimal. I was thinking of setting up some kind of server that has all the data loaded and all the object definitions, and then from a second program/client, I would like to send a predefined type of class (a strategy class) to the server, have the server run the code, and then have the server send me back the results of the test.

I am creating trading strategies in this case, so I have an abstract class that defines what a "strategy" needs. I have a market simulator that calls the derived "strategy" every time the date changes, then the strategy buys or sells stocks, and then stores the profits from the strategy in some result object. So I want to be able to code the strategy part, send it over, and receive the result part.开发者_StackOverflow中文版 I want to avoid loading all the data every time I change params or raw code in my strategy object.

I hope this makes sense to someone and I am sorry if it isn't very clear. Please let me know if this is possible, and then, how would I go about googling for this?? I don't even know what to search for here.


I'd define an Interface that the server will use to invoke your strategies, then implement each strategy in a separate assembly.

The server would then load each assembly in a separate AppDomain and execute it there. This will give the server process some protection against bugs in the strategy implementation, but more importantly will allow it to unload the assembly.


This sounds like a potential security nightmare, but if that's what you want...

Consider sending a serialized workflow to the server for execution. That's just a block of XML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜