Design a message format

本文探讨了短信系统中不同消息格式的特点,特别是二进制消息和XML消息的应用场景及优缺点。二进制消息虽然高效紧凑但牺牲了自我描述性,而XML消息则提供了更好的可读性和扩展性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Where there is communication,there is message exchange.
In a SMS(short message system),there are binary stream based protocols,such as SMPP,SGIP,CNGP,SMGP,etc.
Using binary messages results in efficient exchanges because the message payloads are compact.However,because they are also intended to save space,binary messages sacrifice self-descriptiveness.Consequentyly,both client and server must know the format of binary messages in advance,which means that client and server are tightly coupled.
Extensible Markup Language(XML) messages are at the complex end of the range of messge formats.The MIDP specification does not require XML support.However,developers are free to add XML support to a MIDP application by incorporating additional libraries.
For XML parsing and general processing,developer can choose DOM(Document Object Model) and the SAX(Simple API for XML).
Developer should take care when adding XML support to an application.In addition to the costs in size and bandwidth,there are non-trivial costs in memory,processing, and storage.Developers are advised to measure these costs when deciding to support XML.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值