jorge07 / symfony-6-es-cqrs-boilerplate

Symfony 6 DDD ES CQRS backend boilerplate.
MIT License
1.07k stars 187 forks source link

Refactor Persistence layer in Infrastructure #187

Closed jorge07 closed 3 years ago

jorge07 commented 4 years ago

OK, this ended bigger than expected. Sit down and take a coffee, or two. Yeah two.

[x] Improved naming for async event bus [x] Renamed Query in favour of ReadModel for better consistency [x] Update to Doctrine migrations 3 [x] Updated to symfony 5.15 due to security warnings [x] Moved jwt and doctrine config into packages folder, where it should be living since day one [x] Upgraded phpunit to 9.3 and refactor configuration file [x] Improved async messaging and added routing keys capabilities per transport [x] Added example for async tasks [x] Added final in many places [x] Symplified Async event bus [x] Simplified test suite [x] Upgraded to Elastic 7.9 [x] Symfony messenger routing functional tests

Fixes #185

jorge07 commented 3 years ago

Someone knows how to fix this?

  Line   src/Infrastructure/Shared/Persistence/ReadModel/Repository/MysqlRepository.php  
 ------ -------------------------------------------------------------------------------- 
  24     Unable to resolve the template type T in call to method                         
         Doctrine\Persistence\ObjectManager::getRepository()  
roukmoute commented 3 years ago

Could you send sources about the decided naming strategy?
I don't say it is wrong, just for me and think it is interesting :)

jorge07 commented 3 years ago

Can't really tell you an article I follow 100% but few good reads: First one DDD in PHP, it's the closest thing to this IMO, I don't follow some conventions because I try to ve more explicit, and some patterns like the global event dispatcher are things I avoid. Specially since I mostly do teaching others these days. Said that, you don't have to agree with everything just because is Ina book, but still top 3 PHP books I read. A good issue for context here: https://github.com/dddinphp/book-issues/issues/51 The book is a nice read and I really recommend it after the blue one. For references, this issue in a good summary of how people structure and name https://github.com/webdevilopers/php-ddd/issues/32

I hope you find this helpful

jorge07 commented 3 years ago

BTW your feedback it's more than welcome if you want to share something ;)

jorge07 commented 3 years ago

OK, got that phpstan issue sorted by doing a really shitty design but I need to move forward. I've also found no documentation about how to do functional test for symfony messenger and ended looking at the tests of the library for references. I came with a solution but needs encapsulation. Another problem I face now is the phpunit suite running very slow, will soft that next.

jorge07 commented 3 years ago

@Lutacon feedback welcome in case you want to look at that monster

jorge07 commented 3 years ago

Merging. I promise no more huge Refactors like this