Spring
- Spring is an open source Java framework used to build applications
- Provides various ways to help manage business objects
- Can be considered as a framework of a lot of frameworks
Spring Boot
- Built on top of the spring framework mainly to provide features for developing REST APIs
- Can be used to develop stand-alone production-grade Spring based applications
- Has a embedded server (Tomcat)
- Ultimate goal: developers can quickly create a Spring-based application without writing the same boilerplate configuration
- @SpringBootApplication annotation: covers 3 annotations: @Configuration, @EnableAutoConfiguration, @ComponentScan
Spring Boot Starters
- Pre-configured with the most commonly used library dependencies
- ex) spring-boot-starter-data-jpa : includes all dependencies required to use Spring Data JPA and Hibernate
Spring Boot Autoconfiguration
- Spring Boot automatically configures Spring application based on the jar dependencies added to the project
- ex) spring-boot-starter-jpa : If we add this dependency, then spring boot will automatically register beans such as Data source, Entity manager factory, etc
@SpringBootApplication
- Enables 3 annotations
- @EnableAutoConfiguration: enables Spring Boot Autoconfiguration
- @ComponentScan: enables scanning the components with @Component
- @Configuration: allows to register extra beans or import additional configuration classes