The Big Brains Company - Symfony CQRS Edition
A default structure for CQRS oriented project and Symfony., (*1)
What's inside?
TODO, (*2)
Requirements
1. Quick start
1.1 Install composer if it is not installed yet
Composer installation instructions, (*3)
1.2 Create a new project with composer
$ php composer.phar create-project -s dev tbbc/symfony-cqrs-edition path/to/install dev-master
Composer will install the project and all its dependencies under the path/to/install
directory., (*4)
Note 1: Because it is not stable yet, you have to explicity set the dev-master
version., (*5)
1.3 Visit the project URL
After composer installation is complete, visit the url to the project in your brower for further instructions!, (*6)
2. Overview
2.1 The project structure
DDD (Domain Driven Development) and CQRS (Command/Query Responsability Segregation) aims to focus on the domain (ie: your business)., (*7)
This project structure tries to properly separate the technical aspects and the actual business logic., (*8)
Based on previous experiments, POO paradigms, DDD best practices, we have defined three main "layers" for an application., (*9)
2.1.1 The Domain
It gathers the actual business logic, business rules, free of any framework implementations, (*10)
This layers is splitted in two parts, as defined by the CQRS abbreviation., (*11)
The Command layer is somewhat the write layer, in charge of updating the state of your domain, while the Query is
in charge of Reporting., (*12)
2.1.2 The Infrastructure
Infrastructure relates to any components that are not part of your domain and which interchangeables.
This can be a Doctrine/DBAL repository, a Mailer service, or any third parties adapter.
This is also here that we do the glue between the domain and any MVC framework., (*13)
2.1.3 The UI
CQRS/DDD mainly focus on a "Task Based UI", this means tasks are often mapped to actual command of your domain.
UI, User Interface, is usually a website with HTML views, but it is also any CLI commands or even a REST API., (*14)
2.1.4 Default structure
src
โโโ Acme
โโโ Task
โโโ Command
โโโ Domain
โย ย โโโ Event
โย ย โโโ Handler
โย ย โโโ Model
โย ย โโโ Repository
โโโ Infrastructure
โย ย โโโ InfrastructureBundle
โย ย โโโ Persistence
โโโ Query
โย ย โโโ EventHandler
โย ย โโโ Repository
โย ย โโโ ViewModel
โโโ Ui
โโโ CliBundle
โโโ SharedBundle
โโโ WebBundle
In the Symfony CQRS Edition, the InfrastructureBundle is the heart of the application. It is the glue
between your domain and the actual Symfony framework., (*15)
The UI layer contains all the Controllers, as well as views, themes, or any configuration which will
be passed through container parameters to your Domain., (*16)
Note: the term Command may apply to both CLI Command and Command in CQRS, it should not be confused as it
refers to two different concepts, (*17)
3. Getting started with CQRS
TODO, (*18)
4. Contributing
- Take a look at the list of issues.
- Fork
- Write a test (for either new feature or bug)
- Make a PR
5. Authors
- Boris Guรฉry - guery.b@gmail.com - @borisguery - http://borisguery.com
- Benjamin Dulau - benjamin.dulau@gmail.com - @delendial - http://benjamindulau.com
6. License
The Big Brains Company - Symfony CQRS Edition
is licensed under the MIT License - see the LICENSE file for details, (*19)
, (*20)