domain-engine/library
Composer 安装命令:
composer require domain-engine/library
包简介
A framework agnostic structure providing domain concepts specifications
README 文档
README
A lightweight PHP library providing essential building blocks for Domain-Driven Design (DDD) applications.
Features
- Value Objects: Base implementation for immutable value objects
- Domain Events: Foundation for domain event handling
- Aggregate Root: Base class for aggregate roots in domain models
- Commands: Base command pattern implementation
- Process manager: in development
- Query: in development
- Read model: in development
Requirements
- PHP 8.2 or higher
- Composer
Installation
composer require domain-engine/library
Usage
Value Objects
use DomainEngine\Library\Value\StringValue; class Email extends StringValue { protected static function from(string $value): self { if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { throw new \InvalidArgumentException("Invalid email address"); } } }
Domain Events
use DomainEngine\Library\Domain\DomainEvent; class UserRegistered extends DomainEvent { public function __construct( private string $userId, private string $email ) { } }
Commands
use DomainEngine\Library\Application\Command; class RegisterUserCommand extends Command { public function __construct( public readonly string $email, public readonly string $password ) {} }
Contributing
Contributions are welcome! Please feel free to submit a Pull Request, feedback or Idea.
License
This project is licensed under the MIT License - see the LICENSE file for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-14