Java
General
- Java versions
- Recommended version -> aligned with production. LTS?
- Vendor(s)
- openjdk [Has to be supported by alpine, can change in the future]
Code style
- Formatting
- Following the Google Java Style Guide
- Any deviations??
- (Anti-)patterns
- TODO (requires reference & motivation) [Guideline]
- Exception handling
- In relation to closeable objects
- Use of interfaces
- Re-assigning variables (i.e. not final)
- Mutable collections
- Home brewing common but error prone algorithms
- instead use library, typically guava
- examples: parsing (csv), string manipulations, IO pipelines, ...
- ...
- Exception handling
- Design considerations for applications and services
- OOP principles
Frameworks & libraries
Guideline: for each of the categories in the table below, investigate the applicability of the library listed in the respective ‘guideline’ column before considering alternatives or implementing your own utilities.
Category |
Guideline |
Remarks |
---|---|---|
General utility: Collections, Strings, IO, .. |
Guava |
|
Logging facade |
SLF4J |
|
Log binding |
logback |
Log4j acceptable but considered legacy; migration to logback recommended |
CLI options |
||
Dependency injection |
Spring IoC |
Use general Java annotation (e.g. @javax.inject.Inject) |
Web application (server side) |
Spring (WebMVC, thymeleaf) |
|
Web service |
Spring (WebMVC / WebFlux) |
|
Testing |
JUnit |
|
Mocking |
Mockito |
|
XML testing |
Documentation
- Javadoc
- [Which guideline?]
- Publication
- What to put in README
- Java version
- Build instructions
Build tools & Continuous Integration
- Maven
- Project structure
- Versioning
- Deploying to repository
- [Where to publish]
- Gradle
- Don’t use it [Guideline]
- Ant
- Definitely don’t use it [Guideline] -
Static code analysis
- Maven plugins
- Code coverage
- Static code analysis
Further reading
Recommended books, articles etc: