Card 01/ 06

ConceptDifficulty: Intermediate1 min

The Setup Spring Boot Makes Disappear

A plain Spring MVC application needs a DispatcherServlet registered with a server, a server installed and configured separately from your code, and a dependency list where Spring MVC, Jackson and the server's own libraries all have to agree on compatible versions by hand.

A Spring Boot application needs one dependency and one annotation. Everything above happens anyway — nothing about the mechanism disappears, only the part where you configure it yourself.

java
@SpringBootApplication
public class RideServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(RideServiceApplication.class, args);
    }
}

Boot is not a different framework standing in for Spring. It is Spring, plus a mechanism that looks at what's on your classpath and your own configuration, and creates the beans a typical application with those things on its classpath would need — so you stop writing the configuration for the typical case, and only write the parts where your application isn't typical.