假设我从零开始一个项目,它不依赖于任何其他项目.

我将使用perl.

"Feed"是对产品的描述(名称、价格、类型、简短描述,最多120个单词).

推荐答案

We can't really answer that without knowing a lot more. Just because you're not currently dependent on any other projects, are you likely to interact with them at some point in the future? If so, what technologies do they prefer? At the BBC, we've had some projects "JSON-only", only to find out that Java developers who wanted to access our API were begging us to provide a simple XML API simply because they have so many tool built around XML. They didn't even care about namespaces, attributes, or anything else; they just wanted those angle-brackets.

As for "storing feeds", I also not sure what you mean there. You explain the data in the feed, but what are you then going to do with those feeds? Parse them? Cache and reserve them? Write them out to cuneiform tablets? :)

I sounds like what you actually want is a database and you want to persist the data there and later make it serialisable as JSON/YAML/XML or whatever your desired format is. What I'd recommend is to be able to pull the data out into a Perl data structure and then have "formatters" which know how to serialise that data structure to the desired output. That way you can serialise to, say, JSON, and later if that's not good enough, easily switch to YAML or something else. In fact, if others need your data (one-way data tends not to be useful), they can ask for JSON, YAML, XML or whatever. You have more flexibility and aren't tied into a decision that you made up front.

尽管如此,我不知道你的系统,所以很难说什么是正确的做法.此外,并不是说JSON和YAML不能与XML完全互换.细微的差异会让你绊倒.

Json相关问答推荐

无法根据vega规范中的条件设置文本 colored颜色

将数组中的值作为键连接到另一个数组中的值(Jolt)

如何在PowerShell中访问嵌套的JSON字段

GO KaZaam转换返回意外结果

在Snowflake中查询JSON时,属性名称是否支持绑定参数?

用巨大的值更新SQL Server中的nvarchar(max)

当 JSON 字段名称有空格时,ABAP 中的 JSON 反序列化

Vega-Lite规范:尽管在规范中提供了数据,但显示空图表

使用 jq 从字符串列表开始创建对象

如何在 Android Studio 中将 List 字段作为空列表[]返回?

Google GCM 服务器返回未经授权的错误 401

将 js Array() 转换为 JSON 对象以用于 JQuery .ajax

如何使用 CORS 实现 JavaScript Google Places API 请求

反序列化大型 json 对象的 JsonMaxLength 异常

按 JSON 数据类型 postgres 排序

如何使用 Jackson 定义可选的 json 字段

使用 jq,将对象数组转换为具有命名键的对象

在android中读取Json数组

YAML 将 5e-6 加载为字符串而不是数字

js 中奇怪的 JSON 解析行为,Unexpected token :