IoC & dependency injection
Without IoC, your class goes shopping for its own tools before it can work. With IoC, it arrives and the tools are already on the desk. Spring's container is the office manager who puts them there.
The framework that writes half your application. IoC and dependency injection, bean scopes and lifecycle, auto-configuration, REST controllers, exception handling, profiles and @Transactional.
Without IoC, your class goes shopping for its own tools before it can work. With IoC, it arrives and the tools are already on the desk. Spring's container is the office manager who puts them there.
Stereotype annotations are name badges: @Controller works the front desk, @Service does the thinking, @Repository talks to the database. @Configuration with @Bean is how you hire someone who didn't arrive with a badge — a class from a library you don't own.
A singleton bean is the office coffee machine: one, shared by everyone. A prototype bean is a paper cup: a fresh one each time you ask. The lifecycle is a bean's first day at work: built, given its tools, trained (@PostConstruct), put to work — and given a leaving party (@PreDestroy).
Spring Boot is a flat that comes furnished. It sees what's in your build (a JPA starter, a Postgres driver) and sets up a sensible DataSource, EntityManager and transaction manager. The moment you bring your own sofa — your own bean — it steps aside.
A controller is a restaurant's front counter. GET reads the menu, POST places a new order, PUT replaces an order, DELETE cancels one. @PathVariable is the table number in the URL, @RequestParam is “no onions”, and @RequestBody is the whole written order.
Instead of every chef handling their own kitchen fires, the restaurant has one fire marshal. @RestControllerAdvice catches exceptions from every controller and turns them into tidy, consistent error responses.
Each topic pairs a plain-language explanation with code, interview questions, and related practice where available.