| title | Best Practices |
|---|---|
| description | Architecture, database, security, and testing best practices for IDP-Core |
- Dependency Rule: Domain depends on nothing.
- Interface Segregation: Keep interfaces focused, for example
EntityTemplateRepositoryvs genericRepository. - Exceptions: Throw business exceptions in Domain, handle them in Infrastructure.
- Migrations: Always use Flyway. Never modify existing migration files, they are cumulative and immutable.
- JPA: Use
FetchType.LAZYby default. UseJOIN FETCHfor performance only where necessary.
- Validation: Validate at DTO level (
@Valid) and Database level (unique=true).
- Data: Use dedicated JSON files for test data.
- Builders: Use Builder pattern for creating test objects.