You are not logged in.
Pages: 1
Hi Ab, I was working on my implementation with mormot and I realized that my application layer is strongly attached to my domain layer. I'm using the MormotDDD unit (I think it's incredible) but in my queries and commands I pass as parameter for the aggregates. That is, I need to bring my aggregates to the application layer because queries and commands need their instance. Is there a way to solve this with mormot? A mediator maybe, or don't you see it in a bad way?
Offline
The idea is to write your DTOs according to the extact use cases of the public API.
We use records and dynamic arrays for this purpose.
In practice, we rather use manual methods in the DTO to convert from the domain values to the DTOs fields. Such code is not error-prone, and easy to write, even if a bit verbose.
Online
Oi Ab,
I am using packed record for dtos, they are all anemic. Which case of api public do you refer to? I am using the standard assembler for the conversion of these data. But even in this way, I have a strong coupling between domain layer and application.
Offline
The domain layer is used in the application layer, which publishes only its own DTOs.
The application layer is a layer on the server side, which is called by the actual client applications: web, native....
The application layer service uses one or several domains, and does the link between them.
In the client application itself, there are only those DTOs.
Check the doc about the "DDD Clean architecture".
Online
This ok is exactly what I'm doing, my application layer is a link to the domains, to perform aggregate conversion for Dtos I'm using something like pattern assembler for these conversions. So I'm doing the truck back from the household to Assembler, doesn't it sound strange to you?
I would like to congratulate you for the Excellent framework.
Offline
Pages: 1