Reputation: 255
I'm studying the layers at this momment and i'm wondering where each one should be placed. The webservices i am going to write, in my understanding, should be placed as new projects in the application services layer, acessing domain services in order to feed repositories once some new registry is pushed through it (the webservice will both serve searching and insertions to the database).
The second possibility i thought of would be the webservice to be placed into the presentation layer, having it's own project in the application services layer to process it's requests and access the domain services.
About the external webservices, the webreferences, once again, according to what i understand of DDD, should be placed in the infrastructure layer and the domain services, trough a repository that has it's interface in the domain layer but is placed in the infrastructure layer, would connect to the external webservice and fire the requests.
Any thoughts? I don't think it's based purely on opinion. Thanks in advance
Upvotes: 2
Views: 2018
Reputation: 607
There are two scenarios.
1. You have a web service that someone can call to interact with your application
This web service "uses" your application, thus it should sit outside of your application. It will only know about your application layer and to interact with the domain it will call methods on the application layer.
2. You are calling a web service from your application
In this case that call will live in the integration layer. It can either be accessed via the application layer directly, or you can have an interface in the domain layer, that you implement in the integration layer. This depends on what you are trying to do.
Upvotes: 4