/ddd-symfony-sample

A symfony sample application using DDD

Primary LanguagePHPMIT LicenseMIT

DDD symfony sample application

By Jose Celano

A symfony sample application using DDD.

The purpose: testing some DDD concepts using Symfony.

Domain

  • User can register

Installation

Symfony standard installation.

What I want to test?

Command and Event Bus by Matthias Noback

  • Store events (DDD-CQRS)
  • Handle events asynchronously (for better performance)
  • Log events (for debugging)
  • Use message queue (ActiveMQ and RabbitMQ) to send messages between different application modules

Security layer Michiel Uithol

  • Authorization, where: command, app service?

Repositories

  • Agnostic base repository (implementations with Doctrine, MongoDB, ...)
  • Is possible to use doctrine with annotations and keep domain decoupled? I have seen some people store view instead of domain entity.

Validation

  • Where to put validation: command, domain service, repository?

Usage

On order to test Matthias Noback message bus sample using asynchronous events bus must run this Symfony command to pull events from the message queue:

´´´´ php app/console matthias:user:asyn-event-subscriber ´´´´

Stomp message queue parameter are defined in ´´´´parameters.yml´´´´

´´´´ # stomp message queue stomp_host: 127.0.0.1 stomp_port: 61613 stomp_default_queue: /queue/foo stomp_user: admin stomp_password: adminPassword ´´´´

References

Other DDD Symfony sample applications

The best blogs I have found about DDD+Symfony

Posts that has inspired me.