Spring Boot // App #
Since all the things are inter-connected, we’ll have to do things up-front then comeback to them, as it’ll simplify the understanding without adding too much theory.
Main entity #
- Define the main entity, e.g.
User, Robot, Contact, Game, etc
- You’ll use it for building the skeleton app around it
- Introduce the Create, read, delete, update - CRUD principle
- Create your first controller with CRUD functions and use spring web annotations to map them to java functions.
- Map CRUD to URI.
Model - data and behaviour #
- Use an endpoint that returns all entities
- Create first service
- Create the repository
- Decide on how to organize the code:
- By layer: controllers, services, repositories, entities, etc.
- By feature: houses, products, users (each containing its own controllers, services, etc.)
- Read more here: Martin Sandin / Four Strategies for Organizing Code