You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use wrapper classes for fundamental data types (e.g., Integer instead of int).
BigDecimal for monetary values instead of double or float in FinTech.
Use TODO: comments for unfinished tasks or features.
Use Health Check for application health monitoring. Spring Boot Actuator provides endpoints for health checks.
Metrics Collection: Use Micrometer for collecting application metrics.
Structured Logging: Use a structured logging framework. Application and physical logs like cpu.
Monitoring Setup: Use Prometheus and Grafana for monitoring and visualization.
Use properties files for all static string in the project. For instance CrossOrigin(origins = "${cross.origin.url}") instead of CrossOrigin(origins = "http://localhost:4200")
Do not use @Autowired annotation for constructor injection. Use constructor directly.
Do not use wildcard (*) imports.
Use command + shift + N to create scratch files in IntelliJ IDEA like properties, json, HTTP request, etc.
Prevent Race Condition, Transaction Locking
API Dev: Contract-First Approach (Talk to Business Unit), OpenAPI Spec, API Documentation, Code Generation, Maintainability
Spring Security: Use UserDetails and UserDetailsService implement for Grants, loadUserByUsername, etc.
PATCH: Partially update existing resource, small changes in big resource (data)
DELETE: Remove resource
HOW MUCH REST API: Richardson Maturity Model (0 to 3 - worst to best)
Level 0: Swamp of POX: Single Endpoint, Uses HTTP as tunnel, Soap over HTTP ("There's a single service that determines what to do based on the contents of the payload)
Level 1: Resources: Multiple Endpoints, Single HTTP Method like Everything works over POST, Ex: /users/1234
Level 2: HTTP Methods (Verbs): Proper use of HTTP methods, Status Codes, Ex: GET /users/123
Implement Rate Limiting: API Gateway to Centralize or Custom Middleware
Proper Error Handling: Controller Advice and Global Exception Handling (Controller Advice Uygun Modulde Yakalıyor ve Ona Gore Mesaj Donuyor, Her Yerde try catch Kullanıma Gerek Kalmıyor)
Name Methods in a Descriptive Way: "createAccount" (GetBy{Feature}) instead of "create" for many creative methods can be existing. For Instance: Do not (Controller: getById, create, getAll, update, delete, Repo: deleteById, save, findbyId, findAll)
Use Makefile
Logging Best Practices:
Use SLF4J with Logback for logging.
Use structured logging for better log analysis.
Avoid logging sensitive information.
Use appropriate log levels (DEBUG, INFO, WARN, ERROR).
Implement log rotation and retention policies.
Use correlation IDs for tracing requests across services.
Use ELK Stack (Elasticsearch, Logstash, Kibana) for advanced logging and monitoring.