Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karthikairam/practice-tdd-approach
This project demonstrates the implementation of a Load Balancer using Test-Driven Development (TDD) and Domain-Driven Design (DDD) principles. The solution incorporates different load-balancing techniques, with an emphasis on clean code and maintainability.
https://github.com/karthikairam/practice-tdd-approach
ddd java java17 junit-jupiter maven mockito tdd
Last synced: 13 days ago
JSON representation
This project demonstrates the implementation of a Load Balancer using Test-Driven Development (TDD) and Domain-Driven Design (DDD) principles. The solution incorporates different load-balancing techniques, with an emphasis on clean code and maintainability.
- Host: GitHub
- URL: https://github.com/karthikairam/practice-tdd-approach
- Owner: karthikairam
- License: apache-2.0
- Created: 2025-01-28T17:32:41.000Z (14 days ago)
- Default Branch: main
- Last Pushed: 2025-01-28T18:11:15.000Z (14 days ago)
- Last Synced: 2025-01-28T18:32:53.069Z (14 days ago)
- Topics: ddd, java, java17, junit-jupiter, maven, mockito, tdd
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
# Load Balancer with Strategy Pattern
This project demonstrates the implementation of a **Load Balancer** using **Test-Driven Development (TDD)** and **Domain-Driven Design (DDD)** principles. The solution incorporates different load-balancing strategies, such as **Round Robin** and **Random**, with an emphasis on clean code and maintainability.
---
## Features
- **Load Balancer Registration and Retrieval**
- Register and retrieve server instances efficiently.
- Built to handle both small-scale and large-scale scenarios.- **Strategy Pattern for Load Balancing**
- Support for multiple load-balancing strategies
- Easily extensible to add more strategies in the future.- **Domain-Driven Design (DDD) Principles**
- Created domain entities with proper encapsulation and validations.
- Implemented domain-specific validations and custom exceptions.
- Separated business logic from infrastructure for maintainability.- **Concurrency Handling**
- All operations are thread-safe and designed for concurrent environments.
- Leveraged atomic operations and thread-safe collections for high performance.- **Code Quality**
- Followed **SOLID**, **DRY**, and **YAGNI** principles.
- Comprehensive handling of positive, edge, and negative cases.
- Clean and modular design for maintainability.---
## Tech Stack
- **Programming Language**: Java 17
- **Testing Framework**: JUnit 5
- **Mocking Framework**: Mockito
- **Build Tool**: Maven---
## Principles Followed
- **TDD (Test-Driven Development)**:
- All functionality was implemented incrementally with tests driving the design.
- Covered positive, edge, and negative cases comprehensively.- **DDD (Domain-Driven Design)**:
- Focused on building domain entities, domain validations, and custom domain exceptions.
- Encapsulated business rules within domain objects for clarity and reusability.- **Design Patterns**:
- **Strategy Pattern** for implementing and switching between load-balancing strategies dynamically.- **SOLID Principles**:
- Ensured single responsibility for classes and adherence to open-closed and other SOLID principles.- **DRY and YAGNI**:
- Avoided repetition and only built what was needed to meet the requirements.