Documentation
README
Java 开发规范
参考来源: Google Java Style Guide、阿里巴巴 Java 开发手册
工具链
# Maven
mvn clean compile # 编译
mvn test # 运行测试
mvn verify # 运行所有检查
# Gradle
./gradlew build # 构建
./gradlew test # 运行测试
命名约定
| 类型 | 规则 | 示例 |
|---|---|---|
| 包名 | 全小写,域名反转 | com.example.project |
| 类名 | 大驼峰,名词/名词短语 | UserService, HttpClient |
| 方法名 | 小驼峰,动词开头 | findById, isValid |
| 常量 | 全大写下划线分隔 | MAX_RETRY_COUNT |
| 布尔返回值 | is/has/can 前缀 | isActive(), hasPermission() |
类成员顺序
This is the opening of the README. Read the full README on GitHub.