2017 © Pedro Peláez
 

library command

The command part of the Command Query Responsibility Segregation

image

php-ddd/command

The command part of the Command Query Responsibility Segregation

  • Friday, August 7, 2015
  • by JulienDufresne
  • Repository
  • 3 Watchers
  • 7 Stars
  • 5,621 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Command Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

This library provides some useful tools in order to create a simple command system., (*1)

How it works

// configuration
$handler = new AddItemToChartCommandHandler();
$locator = new CommandHandlerLocator();
$locator->register('AddItemToChartCommand', $handler);

$bus = new SequentialCommandBus($locator);

// usage
$command = new AddItemToChartCommand($item, $chart);
$bus->dispatch($command); // internally, the bus will call the corresponding handler.

Conventions

We want to follow the Single Responsibility principle. Hence: * A CommandHandler can only handle one CommandInterface * A CommandBus will only dispatch some CommandInterface (and nothing more) * A CommandHandlerLocator is responsible of registering associations between Command and CommandHandler, (*2)

It allows us to force some other conventions like the name of the CommandHandler class that needs to match the name of the Command it handle. E.g: AddItemToChartCommand will be handled by a AddItemToChartCommandHandler object., (*3)

The Versions

07/08 2015

dev-master

9999999-dev

The command part of the Command Query Responsibility Segregation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Dufresne
by Damien Buton

01/01 2015

v1.0.2

1.0.2.0

The command part of the Command Query Responsibility Segregation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Dufresne

31/12 2014

v1.0.1

1.0.1.0

The command part of the Command Query Responsibility Segregation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Dufresne

30/12 2014

v1.0.0

1.0.0.0

The command part of the Command Query Responsibility Segregation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Dufresne

15/11 2014

v0.1.0

0.1.0.0

The command part of the Command Query Responsibility Segregation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julien Dufresne