How citerus/dddsample-core works
Main Components
• Frontend/Interfaces Layer: Represented by the “interfaces” package (with sub-packages for booking, handling, and tracking) and the static & template resources under src/main/resources. This layer handles web interactions (REST endpoints, controllers, JSP/HTML pages) and is the entry point for client requests.
• Application Layer: Found in the “application” packages (both under se/citerus/dddsample/application and in the booking facades). This is where use-case orchestration occurs through services such as BookingService, CargoInspectionService, and HandlingEventService.
• Domain Layer: Located under se/citerus/dddsample/domain where the core domain models (cargo, handling, location, voyage, etc.), domain services, and specifications reside. This layer encapsulates business rules and entities.
• Infrastructure Layer: Seen under se/citerus/dddsample/infrastructure. It covers messaging (JMS consumers and producers), persistence (JPA and Hibernate implementations for repositories), routing (integration with external routing services), and sample data generators.
• Additional/Supporting Components: The “com.pathfinder” package provides a separate Graph Traversal service. Although it sits outside the main DDD package hierarchy, it should be represented if it plays a role in the overall system (for example, if graph path computations are integrated into the business logic).
Relationships and Data Flow
• That the Interfaces Layer (web controllers, REST endpoints) receives requests and passes them to the Application Layer.
• The Application Layer coordinates domain logic by invoking Domain layer objects and domain services.
• Domain objects are persisted/retrieved through the Infrastructure layer where both JPA and Hibernate-based repositories reside.
• There is integration with Messaging (via JMS in the Infrastructure layer) and External Routing Services, which feed data or commands back into the domain logic.
• The Pathfinder component (Graph Traversal API) should be depicted as a separate module that might be used internally by application services or as an independent API that can be called externally.
Architectural Patterns and Technologies
• The layered architecture neatly separates concerns (presentation, application, domain, infrastructure).
• DDD principles are central – emphasize aggregates, domain services, repositories, and value objects.
• Use of Spring Boot and Maven (indicated by the pom.xml, Maven wrapper – mvnw) simplifies application startup and dependency management.
• REST endpoints like the HandlingReport API (POST /dddsample/handlingReport) which is defined in the API documentation (api-docs.yaml).
• External messaging integration (JMS consumers for handling event registration).
Final Recommendations
• To include details relevant for a full-stack DDD sample project, with special attention to how domain-driven design is implemented in its code structure.