Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement][ISSUE #878] enhance the ninth point expression in 命名风格.md #879

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion p3c-gitbook/编程规约/命名风格.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<br><span style="color:green">正例</span>:定义整形数组<code>int[] arrayDemo;</code>
<br><span style="color:red">反例</span>:在main参数中,使用<code>String args[]</code>来定义。
8. 【强制】POJO类中布尔类型的变量,都不要加is前缀,否则部分框架解析会引起序列化错误。
<br><span style="color:red">反例</span>:定义为基本数据类型<code>Boolean isDeleted</code>的属性,它的方法也是<code>isDeleted()</code>,RPC框架在反向解析的时候,“误以为”对应的属性名称是deleted,导致属性获取不到,进而抛出异常
<br><span style="color:red">反例</span>:定义为基本数据类型<code>boolean isDeleted;</code>的字段,它的 getter 方法也是<code>isDeleted()</code>,RPC框架在反向解析的时候,“误以为”对应的字段名称是 deleted,导致找不到此字段,进而抛出异常或得到意料之外的结果
9. 【强制】包名统一使用小写,点分隔符之间有且仅有一个自然语义的英语单词。包名统一使用单数形式,但是类名如果有复数含义,类名可以使用复数形式。
<br><span style="color:green">正例</span>:应用工具类包名为com.alibaba.ai.util、类名为MessageUtils(此规则参考spring的框架结构)
10. 【强制】杜绝完全不规范的缩写,避免望文不知义。
Expand Down