Here's the optimized English version with professional DDD terminology and structure:
see https://github.com/c5ms/modern-ddd-cargotracker
Modern DDD Project Structure Guide
This repository demonstrates a contemporary DDD implementation architecture suitable for complex business systems. Below are its core organizational principles and technical implementations:
I. Layered Architecture Design
Domain Layer
- Independent JAR package containing pure business logic
- Framework-agnostic (no Spring dependencies)
- Components:
- Aggregate Roots (Cargo/Voyage)
- Value Objects (DeliverySpecification)
- Domain Services (RoutingService)
- Domain Events (CargoHandledEvent)
Application Layer
- Coordinates domain layer operations
- Implements CQRS pattern for read/write separation
- Components:
- Command Handlers (CargoCommandHandler)
- Query Services (CargoQueryService)
- Event Publishers (EventPublisher)
Infrastructure Layer
- Technical implementation details:
- JPA Repositories (CargoRepositoryImpl)
- ActiveMQ messaging
- Strategy pattern implementations (ThreadPool/MessageQueue strategies)
- Async domain event processing via Spring JMS
II. Key Design Patterns
CQRS Architecture
- Command Side: Handles business mutations
- Query Side: Provides optimized read views
- Uses Event Sourcing for eventual consistency
Strategy Pattern
- Report processing strategies (ReportStrategy interface)
- Supports ThreadPool/MessageQueue/direct execution
- Spring-autowired strategy injection
Event-Driven Architecture
- Async event processing (CargoHandledEvent)
- JMS-based event bus implementation
- Event sourcing storage support
III. Technology Stack
- Spring Boot 3: Simplified enterprise application development
- Spring Data JPA: Repository pattern implementation
- Spring Cloud: Distributed system support
- ActiveMQ: Messaging infrastructure
- Hibernate: ORM implementation
- JUnit 5: Testing framework
- Lombok: Code simplification
This structure demonstrates:
- Clean separation of concerns
- Testable domain logic
- Scalable architecture
- Event-driven communication
- Strategy-based extensibility
Would you like me to elaborate on any specific component or design pattern?