Skip to content

A comprehensive, multi-module Maven project demonstrating core Spring Framework concepts, including Dependency Injection, Bean Lifecycle, Spring JDBC, and Spring ORM with Hibernate.

Notifications You must be signed in to change notification settings

shrihari7396/Spring-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spring Framework Masterclass Repository

Welcome to the Spring Framework Masterclass repository! This project is a comprehensive collection of sub-modules demonstrating various core concepts of the Spring Framework, ranging from fundamental Inversion of Control (IoC) to database integration using JDBC and ORM.

๐Ÿ“Œ Project Overview

This repository is structured as a multi-module Maven project. Each module focuses on a specific set of Spring features, providing practical examples and clear configurations (both XML-based and Annotation-based).

1. springCore (Spring Core Concepts)

This module covers the foundational features of the Spring Framework, heavily focusing on Dependency Injection (DI) and the Inversion of Control (IoC) container.

  • Dependency Injection: Constructor Injection (ci), Setter Injection, Reference Injection (ref), and Collection Injection.
  • Autowiring: Examples of autowiring dependencies using both XML configurations and Annotations (@Autowired).
  • Bean Lifecycle: Understanding bean initialization and destruction using:
    • XML configuration (init-method & destroy-method)
    • Spring Interfaces (InitializingBean & DisposableBean)
    • JSR-250 Annotations (@PostConstruct & @PreDestroy)
  • Configuration Types: Transitioning from traditional XML configurations to pure Java-based configuration (removingXML/JavaConfig).
  • Advanced Core Features: Standalone Collections, Spring Expression Language (SpEL), and Stereotype Annotations (@Component, @Value).

2. springJdbc (Spring JDBC)

This module demonstrates how to interact with a relational database (MySQL) using Spring's JDBC abstraction framework.

  • JdbcTemplate: Performing CRUD operations using JdbcTemplate without standard boilerplate.
  • RowMapper: Mapping database rows to Java objects using custom RowMapper implementations.
  • Design Patterns: Utilizing the DAO (Data Access Object) pattern.
  • Configuration: Setting up data sources and JDBC templates using both XML specifications and pure Java Configurations.

3. springorm (Spring ORM with Hibernate)

This module explores Spring's Object-Relational Mapping (ORM) integration, specifically using Hibernate.

  • Hibernate Integration: Configuring HibernateTemplate and LocalSessionFactoryBean in Spring.
  • Database Operations: Seamlessly performing database CRUD operations mapped to Java entities.
  • Lombok: Using Project Lombok to reduce boilerplate code in Entity classes.

๐Ÿ› ๏ธ Technology Stack

  • Java: Primary programming language.
  • Spring Framework: spring-core, spring-context, spring-jdbc, spring-orm (Version 6.2.1)
  • Database: MySQL Server (mysql-connector-java 8.0.33)
  • ORM: Hibernate Core (Version 5.6.15.Final)
  • Build Tool: Maven

๐Ÿš€ How to Run

  1. Ensure you have Java and Maven installed on your machine.
  2. Set up a local MySQL database and configure the necessary schemas and tables as expected by the entities in springJdbc and springorm.
  3. Update the database credentials (username, password, URL) in the respective config.xml or JavaConfig files across the JDBC and ORM modules.
  4. Run the individual App.java or test.java files located within the specific package of the concept you want to explore.

Happy Learning and Coding with Spring! ๐ŸŒฑ

About

A comprehensive, multi-module Maven project demonstrating core Spring Framework concepts, including Dependency Injection, Bean Lifecycle, Spring JDBC, and Spring ORM with Hibernate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages