Deserialization vs. parsing

旧巷老猫 提交于 2020-01-02 02:04:11

问题


As far as I understand, deserialization is turning a stream of bytes into an object.

Parsing is kinda the same, usually turning a string into some data structure.

Is parsing a type of deserialization? Can you consider them synonymous?


回答1:


Parsing is the more general term.

Deserialization is commonly used in the context of object oriented languages. The result of deserialization is an object while the result of parsing can be any type of data.

Even in the context of object creation, parsing is more general. If for example you create an object and only part of the data required by the constructor is parsed from a file while the rest of the data is provided as user input, I wouldn't call it deserialization.



来源:https://stackoverflow.com/questions/36305368/deserialization-vs-parsing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!