Java Serialization vs JSON vs XML

前端 未结 5 2242
自闭症患者
自闭症患者 2020-12-08 02:53

I am wondering what serialized mechanism should we choose when dealing with object transferring over the network. What are the pros and cons ?

I know most of the tim

5条回答
  •  死守一世寂寞
    2020-12-08 03:11

    I think it depends. If you're sending an http request or something then JSON or XML is obviously a good choice. If you are just sending a java object over a tcp socket for some distributed algorithm or something I think the java serialization is easier/better

提交回复
热议问题