I try to separate my service by features( screaming architecture). I do like this
com.my.app
routes(package)
-OrderRoute
-ResultRoute
exception(package)
-FirstException
-SecondException
api(package)
order(package)
-OrderAPI
-OredrRepository
-OrderEntity
-OrderMapper
-OrderDto
result(package)
-ResultAPI
-ResultRepository
-ResultEntity
-ResultMapper
-ResultDto
I have a routes
package(aka controllers) with routes. Each route uses API class from api
packgae. In the api.order
package I have all classes related to order. The same in api.result
package.
Where should I store common DTOs or DTOs are used by other DTOs. For example, I have AddressDto
. I don't have any controllers or API for that. It is used by OrderDto
and ResultDto
and I don't know where to store it.
Aucun commentaire:
Enregistrer un commentaire