httpflow icon indicating copy to clipboard operation
httpflow copied to clipboard

Why is the implementation of the DeleteContributorService in the core layer?

Open ParsaMehdipour opened this issue 1 year ago • 2 comments

ParsaMehdipour avatar Feb 08 '24 20:02 ParsaMehdipour

Two reasons:

  1. So I could have an example of a domain service
  2. So I could show sending a domain event from a domain service

If there weren't the domain event it could easily have just been in the UseCases folder as a DeleteCommandHandler doing everything. And if you wanted to fire off domain events there, you could, but my preference is to keep them in the domain (as their name implies).

ardalis avatar Feb 08 '24 23:02 ardalis

Thank you for your insightful response. I now comprehend the preferred approach as highlighted in the comments, emphasizing the maintenance of domain service logics in the core layer.

ParsaMehdipour avatar Feb 09 '24 06:02 ParsaMehdipour