Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
1994 committed Jan 15, 2018
1 parent 6369dd9 commit 66bb6d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p3c-gitbook/编程规约/命名风格.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ResourceObserver;
<br><span style="color:orange">说明</span>:JDK8中接口允许有默认实现,那么这个default方法,是对所有实现类都有价值的默认实现。
14. 接口和实现类的命名有两套规则:
1)【强制】对于Service和DAO类,基于SOA的理念,暴露出来的服务一定是接口,内部的实现类用Impl的后缀与接口区别。
<br><span style="color:green">正例</span>:CacheServiceImpl实现CacheService接口。
<br><span style="color:green">正例</span>:CacheServiceImpl实现CacheService接口。<br>
2) 【推荐】 如果是形容能力的接口名称,取对应的形容词为接口名(通常是–able的形式)。
<br><span style="color:green">正例</span>:AbstractTranslator实现 Translatable。
15. 【参考】枚举类名建议带上Enum后缀,枚举成员名称需要全大写,单词间用下划线隔开。
Expand Down

0 comments on commit 66bb6d5

Please sign in to comment.