0% found this document useful (0 votes)
3 views2 pages

Spring Vs SpringBoot Flow

The document outlines the startup flow of traditional Spring applications compared to Spring Boot applications. Traditional Spring requires manual configuration and context creation, while Spring Boot offers auto-configuration and embedded servers, streamlining the process. Both frameworks share the same bean lifecycle methods, but Spring Boot significantly reduces boilerplate code.

Uploaded by

akash.gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Spring Vs SpringBoot Flow

The document outlines the startup flow of traditional Spring applications compared to Spring Boot applications. Traditional Spring requires manual configuration and context creation, while Spring Boot offers auto-configuration and embedded servers, streamlining the process. Both frameworks share the same bean lifecycle methods, but Spring Boot significantly reduces boilerplate code.

Uploaded by

akash.gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Spring vs Spring Boot Application Startup Flow

1. Traditional Spring Application Flow

1. JVM starts and main() method is invoked.

2. Developer manually creates ApplicationContext (XML or Java Config).

3. Spring loads configuration files or configuration classes.

4. Component scanning happens if explicitly enabled.

5. Bean definitions are created and stored in the container.

6. Singleton beans are instantiated eagerly.

7. Dependency Injection is performed (constructor, setter, field).

8. Bean lifecycle methods are executed (PostConstruct, afterPropertiesSet, init-method).

9. Beans are ready for use.

10. Application runs (external server if web application).

11. On shutdown, [Link]() is called.

12. Bean destruction callbacks are executed (PreDestroy, destroy-method).

2. Spring Boot Application Flow

1. JVM starts and main() method is invoked.

2. [Link]() is called.

3. Spring Boot sets up environment and loads [Link].

4. ApplicationContext is created automatically.

5. Auto-configuration is applied based on classpath.

6. Component scanning happens automatically.

7. Bean definitions are loaded into the container.

8. Singleton beans are instantiated.

9. Dependency Injection is performed.

10. Bean lifecycle methods are executed (same as Spring).

11. Embedded server (Tomcat/Jetty/Netty) is started.

12. Application becomes ready to serve requests.

13. On shutdown, Spring closes context and destroys beans.

Key Differences Summary

• Spring requires manual configuration and context creation.


• Spring Boot provides auto-configuration and embedded servers.

• Bean lifecycle is the same in both Spring and Spring Boot.

• Spring Boot reduces boilerplate code significantly.

You might also like