2017 © Pedro Pelรกez
 

project symfony-cqrs-edition

The Big Brains Company "Symfony CQRS Edition"

image

tbbc/symfony-cqrs-edition

The Big Brains Company "Symfony CQRS Edition"

  • Sunday, July 27, 2014
  • by tbbc
  • Repository
  • 21 Watchers
  • 101 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 4 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

The Big Brains Company - Symfony CQRS Edition

A default structure for CQRS oriented project and Symfony., (*1)

What's inside?

TODO, (*2)

Requirements

  • PHP >= 5.3.3

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

  1. Take a look at the list of issues.
  2. Fork
  3. Write a test (for either new feature or bug)
  4. 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)

The Big Brains Company - Logo, (*20)

The Versions