|
About the Compact Formatter
What is the CompactFormatter?
The CompactFormatter is a generic formatter for the .NET Compact Framework. It is fully realized in .NET managed code and this means that it is able to work on every device able to support the .NET Compact Framework or every other standard-compliant CLI implementation. Even if the CompactFormatter is able to serialize automatically the majority of objects using Reflection, it allows programmers to redefine the serialization algorithm of custom objects if this is needed ( such as, for example, if a custom serialization algorithm is more efficient than the standard one ). The interface that the CompactFormatter class expose to the user is very similar to the BinaryFormatter ( or SOAPFormatter ) one and so using it ( or, to some extents, porting applications from .NET to it ) should be very simple for people who knows how to use standard .NET Full Formatters. CompactFormatter is still in Beta (even if we reached 1.0.0 version) simply because it needs more testing. I hope to remove the beta status in a couple of months if no critical problems will be reported. CompactFormatter is and will always be released under the LGPL License.
Features
Why using managed code? It's so slooow...
Indeed, but i chose to use managed code in an effort to gain maximum portability. In fact the world of smart devices is incredibly various and realizing the CompactFormatter completely in managed code allowed me to put just the Compact Framework as a requirement for the CompactFormatter. Anyway, the stream of data produced by the CompactFormatter during serialization is smaller than BinaryFormatter one and this helps to keep the gap small, but it's a fact that the BinaryFormatter ( which works natively ) will out-perform CompactFormatter when several objects are serialized ( because the CompactFormatter needs to wait for the Garbage Collector to come in and free memory ). A rewrite of core serialization routines in native code is definitely a TODO task, but only now that a managed version is ready ( so that if a smart device has not a native version available it could always use the managed one ).
|