There is a problem with Dto's background. Soy new, for favor ayuda :))
I have my Product entity and IProductService in my Domain layer. The problem is that by implementing ProductService in my Application layer, I need to return the DTO that is in Application as well. How do I make the IProductoService method found in Domain return a DTO if it is in the Application layer?
This is the ProductService method where I need to return the DTO.
12 Replies
In this layer: I have the Interface for ProductService
That returns a Producto. But I want to return a ProductoDto (who is n application leyer)
And this is the Application Layer
Obviously generate an error, because that returns a ProductDto
This is a basic architecture error
with this architecture you'd need domain models for the service to use and map that to DTOs in the application layer
but if the service is in the application layer
but the interface isn't
the domain can't know about any higher layers
is there a reason you're doing clean architecture? this is one of its flaws, excessive boilerplate
consider $vsa
For practice
so
the repositoryInterface and service Interface, where do I have to put them?
¯\_(ツ)_/¯
i don't use this architecture for this exact reason
"where do i put this" isn't a question that should take much effort
://
It's for a tecnical interview