Lambdas, private variables, mapping classes, serializability and prevalence levels

I have implemented the prevalence level for Compact Framework (including serializer BinaryFormatter). I would like to be able to serialize classes generated by the compiler that are the result of events like lambdas and iterators where necessary, so if (for example) the lambda and its private variables (i.e. an instance of the display class) are added to the event on the serializable object , and all private variables are serialized, then the resulting graph of objects is still fully serializable.

This is acceptable if instances of these classes can only be deserialized by accurately assembling the binaries from which they were serialized - the prevalence level mainly ensures durability if the application is unexpectedly terminated (power failure and rebooting the device are different possibilities), and a serialized stream data, as expected, will not be either advanced or backward compatible, or even in this case compatible with two compilers of the same source code - all the consequences will be sent are connected to the server when we will talk to him in any case, and we will not update it when disconnected.

Is it reasonable in this limited context for my formatter to consider these classes created by the compiler as if they were serializable? The only alternative that I see is to manually implement the fact that in other models that support the compiler, serialization everywhere is a problem, the consequences of which range from overly detailed to almost unreadable.

+2
source share
1 answer

I see what you are getting, but in my experience, it’s much better to concentrate on serializing the data and processing longevity by rolling back / forth to a known state, perhaps using something like a local CQRS queue, or some other storage method " how did you get there. "

( ..). , , , , - - ( this), (os- ..). ( : - - ), , .

, CF , , , (GetUninitializedObject). , .

+2

All Articles