Do you call services in the same solution directly in the business logic

Topics: General Discussion Forum
Jan 11, 2008 at 9:16 AM
I don't know how to explain myself but if you have in your business logic 2 controllers like CustomerController and AddressController. You also have 2 services CustomerService and AddressService with operations Create(). Each Create() operation in the services is implemented in their controllers. Assume that calling CustomerService.Create() accepts a message with 2 datacontracts namely CustomerDataContract and AddressDataContract. Do you then call in the CustomerController directly AddressController.Create()? Because this would not really be Service-Oriented?

Or should we call AddressService.Create() in the Service Implementation for our CustomerService.Create()? If so where do we place the Service Agent to the AddressService? Because these reside normally in the Resource Access Layer which can normally be accessed through the Business Logic layer.

I hope that I can explain myself well. Please take in mind that we are working with entity-centric services meaning that for each entity in our domain model we need to have one service. On top of that we will also have task-centric services like an ExportService and ImportService. This means that we really need to have an AddressService and that we cannot decide that every operation related to addresses should be done through the CustomerService.