Skip to Content
语义软件设计
book

语义软件设计

by Eben Hewitt
September 2022
Beginner to intermediate
321 pages
4h 50m
Chinese
China Electric Power Press Ltd.
Content preview from 语义软件设计
应用程序
151
并保持严格的统一性。举个例子,你的
API
永远不应该出现这种状况:
API
的某部
分包含一个“查找”函数,另一部分还有一个“搜索”函数,二者的功能几乎相同,
没有明显区别。
你应该在这个阶段确定领域语言,这一点至关重要。创建
API
关键词语的术语表,
无论是“
detach-
”“
disable-
”还是其他词语。假设团队中有一个新来的人,站在这
个人的角度来想象一下术语表,他
/
她作为刚刚加入的新员工,需要尽快熟悉新环境。
写出这些关键词,明确定义,并规定统一的用法。例如,“
get-
”意味着必须在请
求中传递一个唯一的标识符,而且该操作应该返回一个或零个结果。而“
find-
”操
作会接受一些搜索条件,并返回一个集合。
7.5 API
准则
有些团队坚持制定自己的指导方针,供工程师在创建
API
时遵循。我鼓励你从两个
方向制定一套简短的约定:
希望团队以相同的方式使用哪些特定于业务的领域专有名称、想法或专业术语?
由于
IT
团队采用了一些特定机制来处理跨领域问题,因此内部必须使用哪些具
体的准则?其中可能包括基于客户层、安全网关等的限制。这些并非特定于领域,
而是特定于组织。
任何超出该范围的约定都属于重新创造轮子,没有意义。有关开发服务的一般准则,
已经有人提供了。虽然代码的可读性存在各种学术争议(比如大括号是否应该另起
一行),但我建议你服从多数,参考专家制定以及公开的成熟
API
准则。你可以看
看以下这几个准则,然后考虑采用:
微软的
API
设计(
http://bit.ly/2miIQCt
)。
• IBM ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

金融中的人工智能

金融中的人工智能

Posts & Telecom Press, Jeffrey Ng, Subhash Shah
移动端机器学习实战

移动端机器学习实战

Posts & Telecom Press, Karthikeyan NG
精通数据科学算法

精通数据科学算法

Posts & Telecom Press, David Natingga

Publisher Resources

ISBN: 9787519870300