javalisted
Install: claude install-skill matiaspakua/notaire
# Java Development Best Practices
Apply these standards when writing Java code to ensure maintainability, performance, and professional quality.
## Naming Conventions
Follow Oracle's Java naming conventions consistently throughout the codebase.
Use PascalCase for:
- Classes and interfaces: `UserService`, `OrderRepository`, `Comparable`
- Enums: `OrderStatus`, `LogLevel`
- Annotation types: `Override`, `Deprecated`
Use camelCase for:
- Methods: `getUserById`, `calculateTotal`, `isActive`
- Variables and parameters: `userId`, `orderCount`, `firstName`
- Non-constant fields: `private String userName`
Use UPPER_SNAKE_CASE for:
- Constants: `MAX_RETRY_COUNT`, `DEFAULT_TIMEOUT`
- Enum constants: `OrderStatus.PENDING`, `LogLevel.WARNING`
Use lowercase with dots for packages: `com.company.project.module`. Use meaningful names that reveal intent. Avoid Hungarian notation and unnecessary prefixes.
```java
// Good naming examples
public class OrderProcessingService {
private static final int MAX_RETRY_ATTEMPTS = 3;
private static final Duration RETRY_DELAY = Duration.ofSeconds(5);
private final OrderRepository orderRepository;
private final PaymentService paymentService;
private final Logger logger;
public OrderResult processOrder(OrderRequest request) {
var orderId = request.getOrderId();
// Processing logic
}
}
```
## Modern Java Features (JDK 17+)
### Records for Data Classes
Use records for immutable data carriers. Records pro