stratadox/command-handling
Composer 安装命令:
composer require stratadox/command-handling
包简介
README 文档
README
A simple command handling mechanism.
Installation
Install using composer require stratadox/command-handling
Example
<?php use Stratadox\CommandHandling\CommandBus; $bus = CommandBus::handling([ SomeCommand::class => new SomeHandler(), OtherCommand::class => new OtherHandler(), ]); $bus->handle(new SomeCommand('foo'));
Glossary
Command
Commands are simple messages (DTO) that represent a request for an operation. These commands are not the same kind as described in the GOF design patterns, but rather command messages from the CQRS realm.
Handler
A command handler receives the commands, either accepting them and initiating the operation, or denying them and throwing an exception.
Bus
The command bus routes the input command to the appropriate handler.
Middleware
Middleware can be configured to perform operations before or after handling commands, or on exception cases.
Such middleware can be used to introduce automated logging of all requests, to automatically reject unauthorised access or to handle persistence concerns. Using the middleware functionality in this way grants the benefits of what people call aspect-oriented programming, without most of the downsides that come with.
统计信息
- 总下载量: 85
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-28