我目前有一个 PHP 应用程序,我将用 Rails 重写它。我的想法是慢慢用 Rails 替换所有 PHP 功能,因此两者都需要并行运行(我想我已经弄清楚了这部分)。
现在,目前,我们的每个客户端都有一个单独的数据库,事实证明,如果我们可以在客户端之间导入/导出某些对象(基本上为它们设置一些默认对象或在类似社区的方式)。
因此,我的想法是,这是我的 Rails 集成的一个很好的起点,特别是因为它具有 from_xml
和 from_json
等方法。我的问题是:您认为这两者中哪一个更好?我想听听从向后兼容性、可靠性、速度等角度的争论。
非常感谢!
I currently have a PHP app that I'm going to be rewriting in Rails. My idea is to slowly replace all of the PHP functionality with Rails, so both will need to run side-by-side (I think I've got this part figured out).
Now, at the moment, each of our client's has a separate database, and as it turns out, it would be really great if we could import/export certain objects between our clients (basically setup some default objects for them or share them in a community-like manner).
So, my thinking is that this is a great starting point for my Rails integration, especially since it has methods like from_xml
and from_json
. My question is: of those two, which one do you think would be better? I'd like to hear the arguments from the perspectives of backwards compatibility, reliability, speed, etc.
Thanks very much!
发布评论
评论(1)
以下是XML 和 JSON 之间的一些比较。
聪明人说过的话:
我自己的想法:
涉足这个话题有点像小心翼翼地走进雷区。我在上面已经尽力做到公平了。披露:我更倾向于 XML 粉丝,尽管在某些情况下我也会使用 JSON。两者肯定都有一席之地。欢迎对上述内容有不同意见...请用事实而不是仇恨来支持他们。我相信许多人比我更了解这个话题。
Here are some comparisons between XML and JSON.
What smart people have said:
My own thoughts:
Wading into this topic is somewhat like tiptoeing into a minefield. I've tried to be fair above. Disclosure: I tend to be more of an XML fan, though I use JSON too in certain circumstances. There is definitely a place for both. Differing opinions on the above are welcome... please support them with facts and without rancor. I'm sure many on SO know more about this topic than I do.