Swift Protobuf 初探 —— 继 XML 后,JSON 也要被淘汰了吗
2016-12-06 14:33
549 查看
![](http://cc.cocimg.com/api/uploads/20161128/1480299018332924.jpg)
Protocol Buffers 是什么?
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. —— Google Official Definition
简单地说,Protocol Buffers 就是一种轻量高效的结构化数据交换格式,语言无关、平台无关、可扩展。理解地直白粗暴一点就是“更厉害更面向未来的 JSON”,那么接下来我们就将通过 Swift 官方实现的 Protobuf 来一探究竟。
Swift Protobuf
从去掉软盘到干掉光驱,从摈弃 Flash 推广 HTML5 ,到现在干脆把标准音频接口抹去,苹果一向善于引领科技时尚,那么在面向未来的数据交换格式上自然不会落后,因此 Swift Protobuf 应运而生。
开始动手尝试吧
本来我想拿照官方示例来走一遍的,但这次正好有个绝佳的示例,既有客户端又有服务端,可以“做”享其成一次,其中还涉及到 Go 语言,趁此机会也可以把玩一番。
将 ProtoBufExample 克隆至本地
安装 protobuf
探索更多
Google Protocol Buffers
Swift Protobuf
ProtobufExample - Github
深入理解 ProtoBuf
Google Protocol Buffer 的使用和原理 - IBM
相关文章推荐
- Swift Protobuf 初探 —— 继 XML 后,JSON 也要被淘汰了吗
- Swift Protobuf 初探 —— 继 XML 后,JSON 也要被淘汰了吗
- Thrift,protobuf,json,xml,binary之间的对比
- protobuf/json/xml/binary/Thrift数据交换
- protobuf,json,xml,binary,Thrift之间的对比 .
- protobuf,json,xml,binary,Thrift之间的对比
- protobuf,json,xml,binary,Thrift之间的对比
- golang gob 有什么优势? gob/protobuf/json/xml 效率对比,benchmark 压力测试
- JSON vs ProtoBuf vs XML
- xml、json、protobuf、thrift与avro
- App网络传输协议 xml json protobuf
- protobuf/json/xml/binary/Thrift数据交换
- protobuf 与xml,还有json
- Response 异步返回各种格式数据:json xml text Protobuf
- App网络传输协议(Json、XML、protobuf)
- protobuf,json,xml,binary,Thrift之间的对比
- protobuf,xml,json序列化后与解析时间的对比
- 参照protobuf,将json数据转换成二进制在网络中传输。
- 几种序列化协议(protobuf,xstream,jackjson,jdk,hessian)相关数据对比
- ProtoBuf 初探