Domain-Driven Design components implementation
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.
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.
Using Composer:
composer require andrzejkupczyk/ddd-building-blocks
<?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);
}
}