Skip to content

Tahir-Dars/SimpleProjectCrud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleProjectCrud

A simple Java application demonstrating Spring Framework core concepts including Dependency Injection, Inversion of Control (IoC), and layered architecture with user management functionality.

📋 Overview

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.

🛠️ Technologies & Frameworks

  • 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

🏗️ Project Structure

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

✨ Features

  • 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

🎯 Key Concepts Demonstrated

  1. 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
  2. Design Patterns:

    • Dependency Injection
    • Inversion of Control
    • MVC (Model-View-Controller)
    • Repository Pattern

📋 Prerequisites

  • Java Development Kit (JDK): Version 25 or higher
  • Maven: Version 3.6 or higher
  • IDE (optional): IntelliJ IDEA, Eclipse, or VS Code

🎓 Learning Outcomes

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

🔮 Future Enhancements

  • 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

👤 Author

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.

About

Simple project to learn annotations in Spring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages