Writing a Custom Deserializer
Writing a Custom DeserializerWriting a custom deserializer can be time consuming, but the results are certainly worth it. In order to write a custom deserializer, you must first understand the required functionality. Understanding what a custom deserializer is and how it works is a prerequisite to writing one.Serializers are abstractions used to help build data-rich APIs that are extendable and flexible. The serializer provides a type-safe interface for serializing and deserializing a data stream. Serializers support inheritance, parameterization, and 'easy reading' of JSON. In a nutshell, serializers are an abstraction for building software. The syntax used for serializing and deserializing data in a serializer is called an encoder and decoder.Serializers are not written by hand but by writing a serializer is similar to writing a function that can process raw input and produce output data. Some examples of serializers include:The beauty of JSON or XML is that it allows you to constr uct your application data with relative ease. Because of this, you need to be careful when implementing your serializer. In most cases, you should choose the right language and encoding (for example: UTF-8 or JSON-8) for your specific application.Serializers are an essential tool to extend a server-side architecture. There are many types of serializers, but all provide the same basic functionality.Serializers are often written by hand and because of this, documentation and examples are very limited. The advantages of a serializer are that it is easy to learn and use. This means that a serializer can be implemented in a matter of minutes if you know the basics of JSON and XSD and is not difficult to implement when you have knowledge of other formats.A common pitfall when writing a serializer is the lack of confidence in the author. By definition, a serializer is just an algorithm that takes JSON or XML and turns it into something that can be processed by a programming language or env ironment. While a custom deserializer might require more work, it can be a lot less work and you might get better performance from the original data source.If you're interested in implementing serializers or already know the basics of JSON and XSD, it's best to pick a programming language that is well-known and widely used. It's not recommended to pick a language that is unknown or different from most popular languages. Also, a developer who knows their favorite programming language will probably write a better serializer than someone who is just a newbie.
Posted by koty at 5:37 AM