Let's say that I have a bit of .NET code...
public class EventEnvelope
{
public Dictionary<string, string> Headers { get; set; }
public byte[] Body { get; set; }
}
public class EventSelector
{
public Predicate<Dictionary<string, string>> Selector { get; set; }
}
Now I want to send this event selector to an event broker NOT written in .NET.
How might I serialize this predicate in a cross-platform way such that a program written in another language could reconstruct the predicate and execute it?
I had thought of trying to write a serializer that would write out the predicate as a bit of javascript and then either have rhino or jint interpret and execute it at the broker.
Or perhaps there's an actual cross-platform way of representing predicates that I'm unaware of?
What do you think?