andrzejkupczyk / ddd-building-blocks
Domain-Driven Design components implementation
Installs: 18 283
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- andrzejkupczyk/ddd-generic-subdomain: ^1.0
- beberlei/assert: ^3.3
- myclabs/php-enum: ^1.7
- ramsey/uuid: ^4.1
Requires (Dev)
- phpspec/phpspec: ^7.0
Provides
README
This repository helps me experiment with the DDD approach.
All implementations are inspired by books, ValueObject library created by Nicolò Pignatelli, SeedStack Java development stack, ValueObjects toolkit and some other, more direct sources, but mainly by my experiences and needs.
Should I use this library?
Although this package can be introduced as a Generic Subdomain to relieve the Core Domain of a project from unnecessary clutter, it has been developed as an example which probably do not reflect 100% your domain. Therefore, you should rather write your own DDD components using interfaces provided by the DDD Generics package to force members of your team or yourself on thinking in terms of immutable objects and their interaction.
Installation
Using Composer:
composer require andrzejkupczyk/ddd-building-blocks
Example usages
<?php namespace Brunswick\Billiards\Table; use WebGarden\Model\ValueObject\Number\Natural; final class Size extends Natural { protected static function validate($feet) { return parent::validate($feet)->between(7, 9); } }