This package aims to provide you with a bunch of interfaces, abstract classes and concrete value objects which will speed up your project's domain design.
This package is intended to be used, and enriched by following the Domain Driven Design approach.
composer require rayrutjes/domain
We will use strict Semantic Versioning starting from version 1.0.0.
Until we reach that stage, we will allow BC breaks in minor releases, so that we get a package that reflects the DDD way of solving problems as much as possible.
This package is supported on PHP 5.4 and up, but also PHP-HHVM.
Php xdebug extension is required to run phpspec tests.
Because the classes provided by this package will be used in the Domain Layer of applications, it is necessary that we write down some conventions.
- The getters of your entities should not include the "get" prefix.
- The getters of your domain events should not include the "get" prefix.
Note that this list has to be completed with some conventions that make sense from a DDD perspective.
DDD encourages code readability, and in that regard, it feels more natural to read:
$product->price();
Than it would with a "get"ter prefix.
Feel free to contribute to this list of conventions.
To make some great code, you should follow the SOLID principles.
Please verify that you are using the coding standards as defined in PSR-1 and PSR-2.
Run the PHP Coding Standards Fixer before submitting your code.
If you plan on importing a new dependency into this project, please provide a good explanation. We'll then discuss if the dependency should be included or released as a separate package.
$ vendor/bin/phpspec run
Note that phpspec will need xdebug extension to be enabled in order to produce the code coverage files.
Please check that your code coverage is satisfying by consulting the html files residing in the generated "coverage" folder.
- Domain-Driven Design: Tackling Complexity in the Heart of Software from Eric Evans
- Implementing Domain-Driven Design from Vaughn Vernon
- Patterns, Principles, and Practices of Domain-Driven Design from Scott Millett, Nick Tune
- DDD applied to a real Agile Project Management project by Vaughn Vernon,
Todo: Add more references to books, websites, articles and communities as it goes.