How dmertins/video-catalog-admin works
1. Repository shape
- This is a multi-module Gradle project with three architectural modules: domain, application, and infrastructure.
- buildSrc holds shared Gradle convention logic, so build setup is centralized rather than duplicated per module.
- The repo targets JDK 17.
2. Overall architectural direction
- The intended design is DDD + Clean Architecture.
- The domain module is the core model layer.
- The application module is the orchestration/use-case layer.
- The infrastructure module is the outer layer for technical integrations and adapters.
- The README states that layers only know the layers above them, which means the core domain abstractions are meant to remain independent of infrastructure concerns.
3. Domain as the system core
- The domain module contains the reusable building blocks for modeling the business:
- Aggregate
- Entity
- Identifier
- ValueObject
- These types establish the DDD vocabulary used by concrete models and keep identity, equality, and aggregate boundaries consistent.
4. Concrete bounded context currently present
- The only concrete subdomain visible in the tree is Category under domain/category.
- README also names Video, Cast Member, and Genre, but those are not yet present in the file tree, so the repository is currently only partially implemented.
5. Category model boundary
- Category is the main aggregate/entity in the current codebase slice.
- CategoryID is the identity type for that model.
- CategorySearchQuery represents query criteria for retrieving categories.
- CategoryGateway is a domain-facing port, likely the abstraction for persistence or retrieval operations.
- CategoryValidator concentrates business rule checks for the category entity.
6. Validation subsystem
- The domain includes a small validation framework:
- Validator
- ValidationHandler
- Error
- ThrowsValidationHandler
- This indicates validation is handled inside the domain rather than delegated to infrastructure or UI layers.
- The presence of a throwing handler suggests validation errors can be accumulated and then converted into domain exceptions.
7. Exception strategy
- DomainException and NoStackTraceException define the domain’s error model.
- This signals that business-rule failures are treated as first-class domain outcomes, not generic runtime errors.
- NoStackTraceException suggests an optimization or a deliberate choice to reduce noise for expected domain failures.
8. Cross-cutting domain utility
- Pagination exists in the domain module, so paged retrieval is treated as part of the domain contract rather than an infrastructure detail.
- That matters for the architecture diagram because category search is not just a repository concern; it is a modeled use case shape.
9. Application layer role
- The application module exists, but no source files are shown in the tree.
- Based on the architecture description, this layer is intended to hold use cases, orchestration, and transaction boundaries that consume domain objects and domain gateways.
- It likely mediates between input/output models and the domain core, but its implementation is not visible here.
10. Infrastructure layer role
- The infrastructure module also exists without visible source files.
- In this architecture, it is the place for concrete adapters: persistence, external services, configuration, and execution/runtime wiring.
- Its role is to implement domain/application ports such as CategoryGateway.
11. Testing footprint
- There is a domain unit test for Category under domain/src/test/....
- That suggests the domain is intended to be verified independently from technical adapters, which fits the Clean Architecture boundary.
12. What the diagram should emphasize
- Show a core domain module with generic DDD primitives and a Category bounded context.
- Show CategoryGateway as the main abstraction crossing from domain to outer layers.
- Show Application as the use-case orchestrator between inbound requests and domain logic.
- Show Infrastructure as the adapter layer implementing technical concerns and gateway implementations.
- The current repo content is strongest in the domain layer; application/infrastructure are architectural placeholders in the tree rather than fully populated subsystems.
Main entry points: domain/build.gradle Domain Module · Category.java Category · application/build.gradle Use Cases · video.catalog.admin.java-conventions.gradle Conventions
Components 16
Build
Shared Gradle setup and project conventions
- Conventions · Shared Java convention plugin
buildSrc/src/main/groovy/video.catalog.admin.java-conventions.gradle
Domain
Core DDD model and business rules
- Domain Module · Core domain dependency boundary
domain/build.gradle - DDD Primitives · Aggregate, Entity, Identifier, ValueObject
domain/src/main/java/com/dmertins/videocatalogadmin/domain/Aggregate.java - Validation Core · Validator and validation handler contracts
domain/src/main/java/com/dmertins/videocatalogadmin/domain/validation/Validator.java - Domain Errors · DomainException and no-stack-trace failures
domain/src/main/java/com/dmertins/videocatalogadmin/domain/exceptions/DomainException.java - Pagination · Paged query/result shape
domain/src/main/java/com/dmertins/videocatalogadmin/domain/pagination/Pagination.java - Category · Current bounded-context root
domain/src/main/java/com/dmertins/videocatalogadmin/domain/category/Category.java - Category ID · Identity type for category
domain/src/main/java/com/dmertins/videocatalogadmin/domain/category/CategoryID.java - Category Query · Search criteria for category retrieval
domain/src/main/java/com/dmertins/videocatalogadmin/domain/category/CategorySearchQuery.java - Category Gateway · Domain-facing retrieval/persistence abstraction
domain/src/main/java/com/dmertins/videocatalogadmin/domain/category/CategoryGateway.java - Category Rules · Business rule validation for category
domain/src/main/java/com/dmertins/videocatalogadmin/domain/category/CategoryValidator.java - Throwing Handler · Converts validation problems into failures
domain/src/main/java/com/dmertins/videocatalogadmin/domain/validation/handler/ThrowsValidationHandler.java
Application
Use-case orchestration layer
- Application Module · Use-case orchestration boundary
application/build.gradle - Use Cases · Coordinates input, domain, and transactions
application/build.gradle
Infrastructure
Technical adapters and integrations
- Infrastructure Module · Outer technical adapter boundary
infrastructure/build.gradle - Adapters · Persistence, services, and runtime wiring
infrastructure/build.gradle
Connections 19
- Conventions → Domain Module: configures · Applies shared Gradle conventions to the domain module
- Conventions → Application Module: configures · Applies shared Gradle conventions to the application module
- Conventions → Infrastructure Module: configures · Applies shared Gradle conventions to the infrastructure module
- Domain Module → DDD Primitives: contains · Domain module exposes the reusable DDD base types
- Domain Module → Validation Core: contains · Domain module contains validation contracts and handlers
- Domain Module → Domain Errors: contains · Domain module defines the business error model
- Domain Module → Pagination: contains · Domain module models paged retrieval as a domain concept
- DDD Primitives → Category: supports · DDD primitives underpin the category aggregate
- DDD Primitives → Category ID: supports · Identifier abstraction is specialized by category identity
- Category → Category Rules: validated by · Category business rules are enforced through domain validation
- Category → Category Query: searched with · Search use cases are shaped by the category query model
- Category → Category Gateway: exposes · Domain publishes a gateway port for category access
- Category Rules → Throwing Handler: reports to · Validation problems are collected and thrown through a handler
- Application Module → Use Cases: contains · Application module hosts orchestration logic
- Use Cases → Category Gateway: uses · Use cases depend on the domain gateway abstraction
- Use Cases → Category: orchestrates · Use cases coordinate category domain behavior
- Infrastructure Module → Adapters: contains · Infrastructure module hosts technical implementations
- Adapters → Category Gateway: implements · Adapters realize the category gateway port
- Adapters → Use Cases: supports · Infrastructure provides execution-time support for application flows