coding-guidelines-java

Installation
SKILL.md

Coding Guidelines (Java/Spring Boot)

Apply these standards to all Java and Spring Boot code. Focus on robustness, maintainability, and best practices.

Section 1: Java Fundamentals (Effective Java)

Class and Object Principles

  • Immutability: Minimize mutability. Immutable classes are simpler and safer.
    • To create: Provide no setters, make the class final, make all fields final and private, and make defensive copies of mutable components.
  • Composition > Inheritance: Prefer composition over inheritance. Inheritance violates encapsulation.
  • Encapsulation: Minimize the accessibility of classes and members. Use private whenever possible. Never expose public fields; use getters.
  • Interfaces: Prefer interfaces over abstract classes for defining types. Code to the interface, not the implementation (e.g., List<String> list = new ArrayList<>()).
  • equals() and hashCode(): Always override hashCode when overriding equals.

Resource Management

  • try-with-resources: Prefer try-with-resources over try-finally blocks to ensure proper resource closure (AutoCloseable).
  • Avoid Finalizers: Do not use finalizers or cleaners.
Installs
3
First Seen
Jan 30, 2026
coding-guidelines-java — pedrosantiagodev/buildup