I have a domain model to handle complaints. A number of functionalities need to be exposed to the outside world, so I can create a publically available WCF REST service to do that. Other functionalities are meant to be used for internal purposes only (admin stuff), so I can create another WCF service which is hosted internally to do that.
The result is that the same domain model is used by two services.
Technically this means that the same class library is used by two deployable units (the services) – so if the class library changes, I have to deploy the two services.
Is this a bad thing, to have a class library that changes a lot be used by more than 1 deployable unit? Should I maybe have the external service use the internal service instead of the domain model, so that the domain model is only used by the internal service?
Just wondering what the best approach would be, making sure that there are no technical issues afterwards (easy maintenance and deployment). Thanks for the advice!
EDIT: I decided to do it as follows: the public service will be exposed as WCF REST + JSON, and will have only the responsibility to transform data into correct format needed by mobile application. This public service uses the internal command service (WCF with full domain) to execute commands and the internal query service (ADO.NET data service) to do queries.
Is this a bad thing, to have a class library that changes a lot be used by more than 1 deployable unit?
It can create management issues, but sometime is is unavoidable, especially for shared libraries. However, when you are dealing with a domain model it is best to limit the number of services which expose the functionality of the model. I like your proposed solution of having the external service reference the internal service. Then the external service provides a sort of facade over the internal service, and the internal service is focused on exposing the functionality of the domain. However, as pointed out by Thomas Jaskula, it is important to evaluate the behavioral aspect of the services. Is the external service exposing a limited set of functions from the internal service or is it providing different functionality all together? What are the bounded contexts?