Practical use.
WHAT TO LEARN FIRST
Dependency injection and component scanning Controllers and request mapping Configuration properties Data access
WHAT TO KEEP IN CONTROLLERS
Request handling and response shaping.
WHAT TO KEEP IN SERVICES
Business logic.
WHAT TO KEEP IN REPOSITORIES
Data access only.
WHAT TO BE CAREFUL WITH IN DATA ACCESS
Lazy loading producing queries when entities are accessed outside a transaction Relationships loaded eagerly by default, fetching far more than needed The same query-per-item fault as in every ORM
WHAT TO USE
Explicit fetching, and projections returning only the fields needed.
WHAT PROFILES PROVIDE
Different configuration per environment.
WHAT TO EXTERNALISE
Everything differing between environments, particularly credentials.
WHAT TO EXPOSE CAREFULLY
Health and metrics endpoints, which reveal internal detail.
WHAT TO SECURE
Those endpoints, and the administrative surface generally.
WHAT TO TEST
Slices of the application, rather than starting the whole context for every test.
WHY
Full context tests are slow, and slow tests are not run.