V2EX  ›  英汉词典

Schema-first

释义 Definition

schema-first(也作 schema first):一种“先定义模式/契约,再实现代码”的软件开发方式。常见于 API 设计GraphQL:先写出数据类型、字段、输入输出等“协议”(schema),再根据它去实现解析器、服务逻辑与数据层。(也常与 code-first 相对。)

发音 Pronunciation

/ˈskiːmə fɜːrst/

例句 Examples

We use a schema-first approach for our GraphQL API.
我们为 GraphQL API 采用 schema-first 的方式。

In a schema-first workflow, the team agrees on the schema as a contract, then implements resolvers and tests to match it.
在 schema-first 的流程中,团队先把 schema 作为契约达成一致,然后实现解析器并编写测试来与之对齐。

词源 Etymology

schema(模式、架构、纲要)+ first(优先) 组合而成的技术表达,强调“把结构与约定放在实现之前”。该说法在 API 设计与 GraphQL 社区中广泛流行,用来突出“先定接口/类型,再写业务代码”的理念。

相关词 Related Words

文献与作品 Literary Works

  • GraphQL Specification(GraphQL 规范文档,相关讨论中常出现与 schema-first 相对的实现方式)
  • Apollo GraphQL Documentation(Apollo 文档中讨论 schema-first / SDL-first 与实现策略)
  • Prisma Documentation(在 GraphQL/数据建模语境下常涉及“先定义 schema 再生成/实现”的思路)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3192 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 00:32 · PVG 08:32 · LAX 17:32 · JFK 20:32
♥ Do have faith in what you're doing.