DDD, Hexagonal Architecture & CQRS with Symfony and Doctrine

Posted on by

Example of a Symfony application using Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) principles keeping the code as simple as possible. The whole code can be found here. Environment Setup Needed tools Install Docker Clone this project: git clone https://github.com/salletti/symfony-ddd-example.git Move to the project folder: $ cd symfony-ddd-example Application execution If not already done, install Docker Compose Run docker-compose…

CQRS is easy with Symfony 4 and his Messenger Component

Posted on by

Today i want to show you how to use The Messenger Component of Symfony. Very useful when your project implements the CQRS pattern. With an example, simplicity of use and practicality will be evident. Let’s assume that we have a service like this one: <?php namespace App\Domain\Service\Customer; use App\Domain\Command\Customer\DeleteCustomerCommand; use App\Domain\CommandHandler\Customer\DeleteCustomerCommandHandlerInterface; use App\Domain\Exception\Customer\CriteriaNotAllowedException; use App\Domain\Query\Customer\GetCustomerListQuery; use…

Symfony 3: some new features that i like

Posted on by

New in Symfony 3.3: Getter injection As part of our experimental features program, in Symfony 3.3 we’ve added a new feature called getter injection. This adds up to the usual mechanisms used for dependency injection and doesn’t replace any of them. Instead, it provides an additional way that fits some specific use cases. Getter injection…

Circuit breaker pattern – Comment fiabiliser nos microservices

Posted on by

Aujourd’hui les architectures micro-services sont de plus en plus répandues. Mais quels sont les moyens de contrôler votre nouveau système d’information ? Mettons fin au mystère dès maintenant, le circuit-breaker, c’est le disjoncteur de votre architecture micro-services. Mais comment cela fonctionne et pourquoi en aurions-nous besoin ? Voila une suite d’articles intéressants en français concernant le…