Both are used to bootstrap a Spring boot application context. What difference between them?
SpringApplication
SpringApplication is a class to bootstrap a Spring application from a Java main method. It creates an appropriate ApplicationContext instance (depending on the classpath), registers a CommandLinePropertySource to expose command line arguments as Spring properties, refreshes the application context, loading all singleton beans, and triggers any CommandLineRunner beans.
SpringApplicationBuilder
SpringApplicationBuilder is a builder for SpringApplication and ApplicationContext instances with convenient fluent API and context hierarchy support.
SpringApplication do more than SpringApplicationBuilder
No comments:
Post a Comment