Below is architecture of Spring Framework:

| Aspect | Spring Framework | Spring Boot |
|---|---|---|
| Purpose | A comprehensive framework for building enterprise-grade applications. | Simplifies development by providing auto-configuration and embedded servers. |
| Configuration | Requires extensive manual setup using XML or Java-based configurations. | Provides auto-configuration, reducing boilerplate code and simplifying setup. |
| Focus | Modular components for custom solutions. | Productivity and ease of development with opinionated defaults. |
| Deployment | Requires external web/application servers like Tomcat or Jetty. | Includes embedded servers (e.g., Tomcat, Jetty) for standalone applications. |
| Development Effort | Higher effort needed for configuring and integrating components. | Simplifies development with pre-configured starter projects and sensible defaults. |
| Key Features | - Dependency Injection- Aspect-Oriented Programming- Transaction Management- Web MVC Framework | - Auto-Configuration- Embedded Servers- Spring Starters (pre-defined dependencies)- Production-Ready Features (e.g., Actuator) |
| Learning Curve | Steeper learning curve due to the need to understand the core components. | Easier for beginners by hiding much of the complexity of the Spring Framework. |
| Performance | Fully customizable for high-performance scenarios. | Quick to set up and sufficient for most use cases, though less flexibility than the core framework. |
| When to Use | When you need highly customized applications with full control over configurations. | When you want to rapidly develop and deploy applications with minimal setup. |
Key Spring Projects
- Spring Data: Tools for working with SQL and NoSQL databases.
- Spring Cloud: Provides tools for building and managing distributed systems.
- Spring Security: Handles authentication and authorization for applications.
- Spring Session: Manages distributed web application sessions.
- Spring Integration: Implements enterprise integration patterns.
- Spring Batch: Designed for batch processing tasks.
- Spring State Machine: An open-source framework for building state machines.
Simple App in Spring Boot

Runtime and Architecture
- Runtime Environment:
- The application runs on the host OS within a JVM.
- The embedded Tomcat server initializes Spring Boot, routing requests to the application.
- Request Flow:
- Requests are routed to Spring MVC controllers.
- Controllers delegate to a service layer.
- Services interact with Spring Data JPA repositories.
- Repositories interface with Hibernate to generate SQL for database operations.
- Thymeleaf engine generates HTML responses for the browser.
Development Process

- Components:
- Controllers: Handle HTTP requests and responses.
- Services: Encapsulate business logic; written with interfaces for flexibility.
- Repositories: Use Spring Data JPA for database interactions; no SQL required.
- Domain Objects: Plain Old Java Objects (POJOs) configured as JPA entities for persistence.
- Design Patterns:
- Organized into packages:
controllers,services,repositories, anddomain. - Services and repositories leverage interfaces for dependency injection and modularity.
- Organized into packages:
Key Features
- Database: Hibernate facilitates database communication without requiring custom SQL.
- Output: Data retrieval and persistence handled seamlessly, with responses rendered via Thymeleaf.