From 4d24f4de4056912934e41f57d72ee95c3faf4e54 Mon Sep 17 00:00:00 2001 From: zhangyongzhi Date: Fri, 24 Sep 2021 09:50:34 +0000 Subject: [PATCH 1/2] update zh-cn/design/OpenHarmony-API-governance.md. Signed-off-by:zhangyongzhi --- zh-cn/design/OpenHarmony-API-governance.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zh-cn/design/OpenHarmony-API-governance.md b/zh-cn/design/OpenHarmony-API-governance.md index 7cf97fed5b3..a0568c0e539 100755 --- a/zh-cn/design/OpenHarmony-API-governance.md +++ b/zh-cn/design/OpenHarmony-API-governance.md @@ -21,10 +21,9 @@ OpenHarmony API按可授权使用方分类包括:

如无特别说明,本章程定义的条款同时适用于Public API、System API或Test API等三种OpenHarmony API。针对System API和Test API的额外要求或例外说明,通过特别说明方式加以补充说明。

OpenHarmony API按编程语言分类包括: -- Java API:面向应用开放的Java编程语言接口。 - JS API:面向应用开放的JavaScript编程语言接口。 - Native API:面向应用开放的C/C++编程语言接口。 -

如无特别说明,本章程定义的条款同时适用于Java API、JS API和Native API等三种编程语言OpenHarmony API。

+

如无特别说明,本章程定义的条款同时适用于JS API和Native API。

## API治理 @@ -65,7 +64,7 @@ API评审流程如下: 针对变更API,需要额外包含如下要素: 1. 针对老接口的处理方式(废弃、隐藏或彻底删除)以及对使用老SDK开发应用的兼容措施(必须); 2. 变更影响、替代接口和相应的应用适配方案(必须)。 -3. 刷新ChangeLog(必须) 和 API-diff文档(涉及JS/Native API变更,必须;Java API的差异报告可工具化生成,不需要人工提交)。 +3. 刷新ChangeLog(必须) 和 API-diff文档(涉及JS/Native API变更,必须)。 ## API设计要求 ### 一致性要求 @@ -90,10 +89,9 @@ API评审流程如下: 1. 作用域越大,命名应越精确。 1. 不用或少用缩写,业界通用术语遵从行业习惯允许使用缩写。 1. 包名/模块名/命名空间前缀约定: - 1. Java API 统一包名: package ohos.\*。 - 2. JS API 统一模块名:@ohos.\*。 - 3. Native API 统一命名空间:namespace OHOS.\*。 - 4. 引用外部开源代码的,可以保留原包名/模块名/命名空间,也可以按照上述规则对包名统一进行替换。 + 1. JS API 统一模块名:@ohos.\*。 + 2. Native API 统一命名空间:namespace OHOS.\*。 + 3. 引用外部开源代码的,可以保留原包名/模块名/命名空间,也可以按照上述规则对包名统一进行替换。 1. 包名/模块名/命名空间最短不少于2段,最长不超过4段;每一段建议使用一个单词,最长不超过2个单词。 1. 类名、方法名/函数名、成员变量、变量名最多不超过4个单词。 -- Gitee From 226382d56564000db56a2caa6117ab71de2a9980 Mon Sep 17 00:00:00 2001 From: zhangyongzhi Date: Fri, 24 Sep 2021 09:52:11 +0000 Subject: [PATCH 2/2] update en/design/en-OpenHarmony-API-governance.md. Signed-off-by:zhangyongzhi --- en/design/en-OpenHarmony-API-governance.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/en/design/en-OpenHarmony-API-governance.md b/en/design/en-OpenHarmony-API-governance.md index de3ba6a1d9e..b7924c8c80e 100644 --- a/en/design/en-OpenHarmony-API-governance.md +++ b/en/design/en-OpenHarmony-API-governance.md @@ -20,9 +20,8 @@ OpenHarmony APIs are classified into the following types by authorized usage: OpenHarmony APIs are classified into the following types by programming language: -- Java APIs: Java programming interfaces open to applications. - JS APIs: JavaScript programming interfaces open to applications. -- Native APIs: C/C++ programming interfaces open to applications. Unless otherwise specified, the terms defined in this Charter also apply to Java APIs, JS APIs, and Native APIs. +- Native APIs: C/C++ programming interfaces open to applications. Unless otherwise specified, the terms defined in this Charter also apply to JS APIs, and Native APIs. ## API Governance @@ -68,7 +67,7 @@ For changed APIs, except the preceding composites, the following must be include 1. (Mandatory) How old APIs are handled (deprecated, hidden, or permanently deleted) and compatibility measures for developing applications using old SDKs. 2. (Mandatory) Change impact, substitute APIs, and corresponding application adaptation solution. -3. (Mandatory) Update the ChangeLog file. Update the API-diff file (Mandatory if JS/Native API changes are involved. Optional for Java API changes because this file is automatically generated using the tool and do not need to be manually submitted.) +3. (Mandatory) Update the ChangeLog file. Update the API-diff file (Mandatory if JS/Native API changes are involved.) ## API Design Requirements @@ -98,10 +97,9 @@ Design APIs from the perspective of their users rather than providers. 4. The larger the scope is, the more precise the naming should be. 5. Do not use or minimize the use of abbreviations. Common terms in the industry must comply with industry conventions and can be abbreviated. 6. Package name/module name/namespace prefix convention: - 1. Java API package name: package ohos.\*. - 2. JS API module name: @ohos.\*. - 3. Native API namespace: namespace OHOS.\*. - 4. If external open-source code is referenced, retain the original package name, module name, or namespace, or replace the package name according to the preceding rules. + 1. JS API module name: @ohos.\*. + 2. Native API namespace: namespace OHOS.\*. + 3. If external open-source code is referenced, retain the original package name, module name, or namespace, or replace the package name according to the preceding rules. 7. The package name, module name, and namespace must contain at least two and at most four segments. One word is recommended for each segment, and a maximum of two words are allowed. 8. The class name, method name, function name, member variable, and variable name cannot exceed four words. -- Gitee