We're creating a new application for an entirely new domain model
(and Bounded Context
) 'Appointment
'. We chose to combine CQS
with Hexagonal Architecture
(using ports and adapters) for our new domain.
Our package structure mainly looks like this:
.appointments
.application
.command
.representation
- AppointmentScheduleApplicationService.java
- AppointmentScheduleQueryService.java
.domain.model
.port.adapter
.integration
.persistence
.web
.service
- AppointmentScheduleFacade.java
My questions:
- Is this package structure OK for what we're trying to achieve?
We would want to see every communication to/from other domains via the
AppointmentScheduleFacade
interface. Cross-domain communication resides as plain method invocations (no RPC or REST) as they're not distributed.The facade mainly delegates to :
AppointmentScheduleApplicationService.java
for model modificationAppointmentScheduleQueryService.java
for passing data to other domains.
Is this setup OK? Or should an other domain correspond directly with Application
and QueryService
?