anonymous methods and serialization

I am developing a server-side framework in C# that handles rapidly changing data (i.e. > 50k updates per second) and I need to offer a .NET Remoting interface into which client apps can query, in real-time, state across hundreds of thousands of objects.

I want to let the client-side app developer have as much freedom as possible to develop the query.

From my basic understanding of C# 2.0, it seems like anonymous methods could possibly be useful here. Particularly if a method can be defined in the client, serialized and passed through the Remoting interface, and then executed on the server.

Assuming that all of the referenced types are also serializable, is this design possible

If not, why not

In past lives, I've used scripting languages like Perl and Tcl for this 'glue'. I.e. the client creates a Tcl script that contains the query, which is passed in over a socket and compiled and run on the server in real-time. It would be great if the C# architecture team actually anticipated this usage pattern and designed anonymous methods to support it. Wishful thinking



Answer this question

anonymous methods and serialization

  • ltca

    anonymous methods seems to be useful only in quering scnerios of collections....

    but that is only me..

    .I see them as using closures as functors and help us in collections.


  • ElChairo

    After much further investigation, it turns out the IronPython is way to go with this.

    If you are looking for a way to incorporate language extensibility to a .NET project, something like IronPython, or possibly Boo (uninvestigate by me, but recommended elsewhere) are worth checking out.


  • RandyGephart

    After further investigation, I don't believe that anonymous methods are designed to work as I would like. While I can serialize an anonymous method and pass it to a Remoting service, it apparently barfs on the server-side because it can't see the client-side assembly which seems to have auto-generated an underlying method to implement the anonymous method.

    However, that was the entire point, I don't want the server to have to see the client-side code to get this done.

    FWIW, it appears that C# 3.0 has a new language extension capability called LINQ that *may* be targeted at this functionality.

    http://msdn.microsoft.com/vcsharp/future/

    I guess I only have to wait 18 months, or so.

    Any suggestions would be much appreciated.

  • anonymous methods and serialization