what is the difference between Serializing and encoding?

前端 未结 2 2097
南笙
南笙 2021-02-05 02:57

what is the difference between Serializing and encoding? and when should i use each in a web service?

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 03:05

    Serializing is about moving structured data over a storage/transmission medium in a way that the structure can be maintained. Encoding is more broad, like about how said data is converted to different forms, etc. Perhaps you could think about serializing being a subset of encoding in this example.

    With regard to a web service, you will probably be considering serializing/deserializing certain data for making/receiving requests/responses - effectively transporting "messages". Encoding is at a lower level, like how your messaging/web service type/serialization mechanism works under the hood.

提交回复
热议问题