Each Java project should follow a given coding style. I.e., all contributions to the source code should use the same formatting rules, design principles, code patterns, idioms, etc. This coding style provides the set of rules that I am using in my lectures about software development at Munich University of Applied Sciences.
This project describes the coding style in detail (currently only available in German) and serves as a template project. It provides all necessary resources for a Java project to enforce this coding style using the following static analysis tools via Maven (and partly in IntelliJ):
❗Compiling this project requires a JDK version of 11 or higher (event though the language level still is set to Java 8 for all classes and dependencies).
Moreover, this project provides some sample classes that already use this style guide. This classes can be used as such but are not required in this project. These classes also use some additional libraries that are included using the Maven dependency mechanism. If the sample classes are deleted then the dependencies can be safely deleted, too.
This project and the associated static analysis tools are already running in continuous integration: an example CI pipeline is active for GitHub Actions. For Jenkins a full CI pipeline has been configured that includes stages to compile, test, run static code analysis, run code coverage analysis, and run mutation coverage analysis, see section Continuous Integration for details. Additionally, some development tools are configured in this GitHub project, that evaluate the quality of pull requests, see section integration of external tools.
Content of the style guide (only in German):
- Best Practice
A lot of ideas in this style are based on the following path-breaking books about software development:
-  "The Elements of Java Style", Vermeulen, Ambler, Bumgardner, Metz, Misfeldt, Shur und Thompson, Cambridge University Press, 2000
-  "The Pragmatic Programmer: journey to mastery", Second Edition, Andrew Hunt, David Thomas, Addison Wesley, 2019
-  "Code Complete: A Practical Handbook of Software Construction", Steve McConnell, Microsoft Press, 2004
-  "Clean Code: A Handbook of Agile Software Craftsmanship", Robert C. Martin, Prentice Hall, 2008
-  "Effective Java", Third Edition, Joshua Bloch, Addison Wesley, 2017
-  "Refactoring: Improving the Design of Existing Code", Martin Fowler, Addison Wesley, 1999
-  "Java by Comparison", Simon Harrer, Jörg Lenhard, Linus Dietz, Pragmatic Programmers, 2018
All documents in this project use the Creative Commons Attribution 4.0 International License. Source code (snippets, examples, and classes) are using the MIT license.