Performance: Why Spring Boot over plain Spring
MEDIUM IMPACT
This concept affects application startup time, developer productivity, and runtime configuration efficiency.
@SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } // application.properties handles datasource config automatically
public class AppConfig { @Bean public DataSource dataSource() { DriverManagerDataSource ds = new DriverManagerDataSource(); ds.setDriverClassName("com.mysql.cj.jdbc.Driver"); ds.setUrl("jdbc:mysql://localhost:3306/db"); ds.setUsername("user"); ds.setPassword("pass"); return ds; } // many more manual bean definitions and XML configs }
| Pattern | Configuration Complexity | Startup Time | Error Risk | Verdict |
|---|---|---|---|---|
| Plain Spring with manual XML and Java config | High (many lines, verbose) | Long (hundreds ms more) | Higher (manual errors) | [X] Bad |
| Spring Boot with auto-configuration and starters | Low (minimal config) | Short (faster startup) | Lower (convention over config) | [OK] Good |