dddshelf / last-wishes

Last Wishes is a PHP application written following Domain-Driven Design approach. It's one of the sample applications where you can check the concepts explained in the "Domain-Driven Design in PHP" book.
https://leanpub.com/ddd-in-php
660 stars 120 forks source link

LoggerDomainEventSubscriber.php coupled to infrastructure at domain layer #28

Open borjapazr opened 3 years ago

borjapazr commented 3 years ago

The LoggerDomainEventSubscriber.php is located in the Domain layer. In addition, it uses functionalities specific to the Infrastructure layer, such as Monolog or Elastica.

Wouldn't it be more appropriate and consistent with the principles dictated by DDD to create a contract (interface) of the Logger in Domain layer, implement it in the Infrastructure layer and then create a subscriber of the domain events in the Application layer?

Thanks in advance 😊