C++ 的 XML 数据绑定就像 Java 的 JAXB

发布于 2024-11-28 19:31:33 字数 500 浏览 4 评论 0原文

我在“C++ 中数据绑定和解析的使用”领域中以完全**天真**的方式写下这个问题。所以,请耐心听我说。 :)

您可能会发现此问题与重复

经过一番谷歌搜索后,我发现 C++ 具有与 JAXB for java 类似的库,用于以“代码合成 xsd”和“Boost Serialization”的形式表示 XML 的对象

1)现在我想问的是“Boost Serialization”可以执行CodeSynthesis能够执行的所有功能吗?

2)如果是的话,如果我们考虑到的话,使用哪一个会更好

 1) Dependency   2) Performance   3) Ease of use 

3)如果与Java JAXB相比,它的性能如何? [可选问题......仅当有人有基准链接时]

谢谢。

I am writing this question as a complete **naive** in this field of "Use of data binding and parsing in c++". So, please bear with me . :)

You may find this question as duplicate of THIS

After doing a bit of googling I found that what C++ has similar library to JAXB for java for object representation of an XML in the form of "Code Synthesis xsd" and "Boost Serialization"

1) Now what I want to ask is that can "Boost Serialization" perform all the functions that CodeSynthesis is able to do ?

2) If yes, which one of it would be better to use if we take into account

 1) Dependency   2) Performance   3) Ease of use 

3) What would be its performance if we compare with Java JAXB ? [Optional question...only if someone have a link to the benchmarks]

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是在用心讲痛 2024-12-05 19:31:33

回答第一个问题:不!序列化几乎总是数据绑定的一小部分。数据绑定为您提供特定针对您的架构的对象模型。这意味着您必须有一个架构才能使用数据绑定。不需要 XML 序列化/反序列化。也检查一下:http://www.rpbourret.com/xml/XMLDataBinding.htm

2)这就像比较苹果和橘子。就易用性而言,我认为数据绑定更好。

3)该线程看起来相关: http://lists.xml.org/档案/xml-dev/200812/msg00141.html

Answer to the first question: No! Serialization is almost always a small subset of data-binding. Data binding gives you an object model specific to your schema. That means you have to have a schema to use data-binding. No such need for XML serialization/deserilization. Check this too: http://www.rpbourret.com/xml/XMLDataBinding.htm

2) It is like comparing apples and oranges. As far as ease-of-use is concerned, I would say data binding is better.

3) This thread looks relevant: http://lists.xml.org/archives/xml-dev/200812/msg00141.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文