Auto-Configuration
Explore how Spring Boot's auto-configuration feature reduces configuration complexity by automatically setting up beans like DataSource and DispatcherServlet based on available dependencies. Understand the underlying mechanism and how it streamlines application development.
Configuration bloat
As we have seen in our conventional Billionaire’s Club lesson, creating a simple web application requires configuring essential Spring beans before the start of actual development.
For example, when we use Spring MVC, we need to configure Component scan, Dispatcher Servlet, view resolver, etc.
When we use hibernate/JPA in our Spring application, we need to configure DataSource, a connection pool, EntityManager and Transaction Manager, among other things.
Spring boot - think differently
Can we do this in a smarter way? Think of configuring:
- A
DataSource, if the Hibernate JAR is on the classpath. - A
DispatcherServlet, if the Spring MVC JAR is on the classpath. - An