DDD - What is the best option (Layer) to consume an external Webservice?

Asked

Viewed 850 times

3

Pattern DDD.

I need to consume one Webservice external, treat the return of that Webservice and return the result through the layer of Application.

It would be interesting to consume this Webservice in the layer of Infrastructure and treat it as an external repository?

It would be interesting to consume this Webservice in the layer of Services?

  • DDD is focused on business and not technology. So whether or not the data comes from a web service is not relevant to determining where the web service will be consumed; what you should consider is the relevance of the data in the domain. Also, in DDD there is no "services layer". In DDD, service is a domain object type and not a layer. See: http://answall.com/q/49607/14584

  • In the Repository folder I create a project "Services".

1 answer

5


It would be interesting to consume this Webservice in the Infrastructure layer and treat it as an external repository

I would use this way, in which you already give the answer in the question(data collection is infra/Repo)"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.