Spring Framework Tutorial 0/14 lessons ~6 min read Lesson 3

    Spring Framework vs Spring Boot

    Newcomers often blur the line.

    Course progress0%
    Focus
    7 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    Newcomers often blur the line. Spring Framework is the core library (container, MVC, AOP, data, security modules). Spring Boot is a thin layer on top that adds auto-configuration, starter dependencies and an embedded server, so a new project runs in minutes instead of days.

    Boot does not replace the framework — it preconfigures it. Every Boot feature ultimately calls Framework APIs you can use directly. That is why this course teaches the Framework: it is the foundation under everything Boot does.

    Understanding the topic

    The differences in one table-like list:

    • Wiring: Framework → you write config classes. Boot → opinionated defaults already wired.
    • Dependencies: Framework → pick versions yourself. Boot → curated starters (e.g. spring-boot-starter-web).
    • Server: Framework → deploy a WAR to Tomcat/Jetty. Boot → embedded server, java -jar and you're live.
    • Properties: Framework → load yourself. Boot → unified application.yml with profiles.
    • Observability: Framework → add libraries. Boot → Actuator endpoints out of the box.

    Syntax reference

    The smallest possible Boot app:

    java
    @SpringBootApplication
    public class App {
    public static void main(String[] args) {
    SpringApplication.run(App.class, args);
    }
    }
    @RestController
    class Ping {
    @GetMapping("/ping") String ping() { return "pong"; }
    }

    Six lines and you have an HTTP server. The same setup in pure Framework takes a web.xml, a DispatcherServlet bean, a server configuration, dependency management — easily 50+ lines and several files.

    Real-world use

    Almost every new Spring project today is a Boot project — but the moment something breaks, you debug inside the Framework. Knowing the layer below Boot is what separates a tutorial follower from an engineer who can fix production incidents at 3 AM.

    Best practices

    • Use Boot for new projects. Use your Framework knowledge to understand and override Boot's defaults.
    • Read the auto-configuration report (--debug flag) to see what Boot wired for you.
    • Override defaults by declaring your own bean — Boot backs off when it sees one.

    Common mistakes

    • Believing Boot is its own framework — it isn't, and that belief slows your learning.
    • Fighting Boot's defaults instead of overriding them with a single @Bean.

    Hands-on exercise

    Compare: bootstrap the same "hello world" REST endpoint twice — once as a pure Spring Framework project (with explicit DispatcherServlet wiring), once with Spring Boot. Count the lines of configuration in each. Reflect on what Boot did for you.

    Ready to mark this lesson complete?Track your journey across the entire course.