Skip to content

AsrielDreemurrGM/Java_Backend_Project2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Java Backend Project 2

This is my second backend project using Java, focused on deepening core concepts like TDD (Test-Driven Development), Generics, and Unit Testing with a structured and modular approach.
It follows the same CRUD foundation as the first project, but this time with a strong emphasis on writing tests first and applying best development practices.

🔗 Want to have a look at the first project? Check out Project 1 - Java CRUD Example, it’s the starting point of my Java journey.

📌 Features

  • Application of the TDD methodology: tests are created before implementation;
  • Usage of Generics for both DAO and Service layers to reduce code repetition;
  • Custom domain models like Client and Product implementing a Persistable interface;
  • GenericMapDAO and GenericService for reusable CRUD operations across entities;
  • Unit tests using JUnit 5, structured for DAO and Service layers with mock implementations for isolation;
  • Dependency injection used to wire DAOs into services in the test setup;
  • Detailed Javadoc comments across classes and test files;

🗂️ Project Structure

  • br.com.eaugusto.domain: Domain models like Client and Product, and the Persistable interface;
  • br.com.eaugusto.dao: DAO interfaces and implementations, including ClientDAO and ProductDAO;
  • br.com.eaugusto.dao.generics: Generic DAO interfaces and base implementations using Map storage;
  • br.com.eaugusto.services: Service interfaces and classes, such as ClientService and ProductService;
  • br.com.eaugusto.services.generics: Generic service interfaces and implementations using the generic DAO layer;
  • br.com.eaugusto (test): Contains test classes for DAO and service layers using mock implementations and dependency injection;

🧪 Testing Approach

  • Follows the test-first approach with JUnit 5;
  • Includes coverage for CRUD operations on both service and DAO layers;
  • Mock classes like ClientDAOMock and ProductDAOMock simulate data access for isolated tests;
  • Each test class includes setup logic, method verification, and meaningful assertions;
  • Coverage tools like EclEmma are being used for visual feedback during development.

📅 Commit Highlights

June 25, 2025

  • Added Javadoc to ProductServiceTest for clarity and documentation;
  • Completed ProductService and its test class, following the TDD pattern;
  • Updated Product to use a default constructor and setter-based initialization in tests.

June 24, 2025

  • Created Product entity and DAO with full test coverage using ProductDAOMock and ProductDAOTest;
  • Applied generic DAO structure to both Client and Product workflows.

June 23, 2025

  • Implemented delete and modify actions in DAO and service layers with respective tests.

June 22, 2025

  • Initial project setup with domain models, DAO, and service layers for Client;
  • Set up TDD structure and created first unit tests.

📚 Learning Goals

  • Practice TDD effectively in a real-world-style CRUD application;
  • Use generics to build flexible, reusable service and DAO layers;
  • Write clean, modular tests that simulate business logic and edge cases;
  • Understand the integration of Swing (coming soon) into backend-driven Java apps.

About

My second Java backend project. Made to manage client and product data with CRUD operations. Uses generic DAO, service patterns, and has unitary tests coverage with JUnit 5.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages