A simple Java application demonstrating Spring Framework core concepts including Dependency Injection, Inversion of Control (IoC), and layered architecture with user management functionality.
This project is a learning-focused implementation that showcases Spring Framework fundamentals without using Spring Boot. It demonstrates a clean separation of concerns using the MVC pattern with an in-memory data storage approach.
- Java: Version 25
- Spring Framework: Version 7.0.2
- Spring Core
- Spring Context
- Maven: Build and dependency management
- Architecture: MVC pattern with Repository-Service-Controller layers
SimpleProjectCrud/
├── src/
│ └── main/
│ └── java/
│ └── com/
│ └── entries/
│ ├── Configuration/
│ │ └── AppConfig.java # Spring configuration class
│ ├── Controller/
│ │ └── userController.java # Handles user operations
│ ├── service/
│ │ └── userService.java # Business logic layer
│ ├── repository/
│ │ └── userRepository.java # Data access layer
│ ├── db/
│ │ └── dbconn.java # In-memory database simulation
│ └── MainApp.java # Application entry point
├── pom.xml # Maven configuration
└── README.md
- Dependency Injection: Automatic bean management through Spring IoC container
- Component Scanning: Auto-detection of Spring components (
@Controller,@Service,@Repository) - Bean Lifecycle Management: Custom initialization (
init()) and cleanup (clean()) methods - Layered Architecture:
- Controller Layer: Handles user interactions
- Service Layer: Contains business logic
- Repository Layer: Manages data access
- Database Layer: Simulates in-memory storage
-
Spring Annotations:
@Configuration- Configuration class@ComponentScan- Automatic component discovery@Component- Generic Spring component@Controller- Presentation layer component@Service- Business logic component@Repository- Data access component@Autowired- Dependency injection@Bean- Bean definition with lifecycle methods
-
Design Patterns:
- Dependency Injection
- Inversion of Control
- MVC (Model-View-Controller)
- Repository Pattern
- Java Development Kit (JDK): Version 25 or higher
- Maven: Version 3.6 or higher
- IDE (optional): IntelliJ IDEA, Eclipse, or VS Code
This project helps understand:
- -->Annotations
- Spring Framework basics without Spring Boot
- Dependency Injection and IoC principles
- Clean architecture and separation of concerns
- Component-based development
- Bean lifecycle management
- Spring annotations and their usage
- Add actual database integration (MySQL/PostgreSQL)
- Implement full CRUD operations (Update, Delete)
- Add REST API endpoints using Spring MVC
- Include user authentication and authorization
- Add unit tests (JUnit, Mockito)
- Implement exception handling
- Add logging framework (SLF4J, Logback)
- Create a web interface
- Migrate to Spring Boot for simplified configuration
- Add Docker support
Tahir Dars
- GitHub: @Tahir-Dars
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Note: This is a learning project designed to demonstrate Spring Framework core concepts. For production applications, consider using Spring Boot with proper database integration and security measures.