- Overview of Spring Framework
- Why Spring is used
- Course overview / motivation
- Tight Coupling: Direct dependency between classes
- Loose Coupling: Uses abstraction (interfaces)
- Inject dependencies instead of creating them
- Types:
- Constructor Injection
- Setter Injection
- What is a Web Framework?
- Why Spring?
- IOC (Inversion of Control)
- Beans
- Application Context
- Using Maven / Gradle
- Project structure
- Dependency management
- Build lifecycle
- Define and use a bean
- Convert traditional object creation to Spring
- Removes tight coupling
- Improves maintainability
- XML complexity
- Maintainability issues
@Component@ComponentScan@Configuration
- Automatic dependency injection
@Service@Repository@Controller
- Solutions:
@Primary@Qualifier
- Initialization → Usage → Destruction
- Java config + Annotation config
- Controller → Service → Repository
- Auto configuration
- Embedded server
- Spring Initializr
- Predefined dependencies
- Configuration file
- Run code at startup
- Common concepts
- REST principles
- Basic controller
- GET, POST, PUT, DELETE
- Object → JSON
- Map HTTP requests
- DispatcherServlet → Controller → Service
- CRUD operations
- Create data
- Update data
- Remove data
- Control response & status codes
- Passing data in URL
@PathVariable
@RequestParam
- Handle multiple inputs
- Access headers
- Use together in one API
- Runtime error handling
- Clean architecture
- Default exceptions
- Handle specific errors
@RestControllerAdvice
- User-defined errors
- Levels:
- INFO
- DEBUG
- ERROR
- Understand database basics
- Add dependency
- Establish connection
- Auto close resources
- INSERT
- SELECT
- UPDATE
- DELETE
- Prevent SQL Injection
- Group operations
- Maintain consistency
- Object Relational Mapping
- Abstraction vs manual SQL
- Session
- SessionFactory
- CRUD operations
- Advanced concepts
- Core JPA operations
- Combine with Spring Boot
- Controller → Service → Repository
- Connect tables
- Single mapping
- Parent-child relation
- Multiple connections
- Auto save/update/delete
- Advanced mappings
- Build production-ready Spring Boot applications
- Master REST APIs, JPA, and backend architecture