Download the PHP package black/ddd-php without Composer
On this page you can find all versions of the php package black/ddd-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download black/ddd-php
More information about black/ddd-php
Files in black/ddd-php
Package ddd-php
Short Description Implements DDD in PHP
License MIT
Homepage http://www.lablackroom.com
Informations about the package ddd-php
DDD PHP
DDD in PHP is a simple project (a folder structure) for your project build with Domain Driven Design.
Installation
The recomanded way to install DDD in PHP is through Composer:
Protip: You should browse the black/ddd-php
page to choose a stable version to use, avoid the @stable
meta
constraint.
Why?
First, I want to create a folder structure for my continuous project based on semantic. This small library is a good start for my project and, even if some parts of this integration versus DDD rules are questionable, this library will work for a lot of projects.
Usage
This project is a simple folder structure with interfaces (with simple contracts). Follow this structure and your project will follow DDD (not exactly true but your design will be fine).
Why you should not use this library in your project?
For a lot of good reasons like :
-
Repository interface is in Domain\Model with 4 basics functions. If you want to add CQRS pattern over this interface, you will need a Read and a Write side so you can't scale with this interface.
- Repository::find() need a ValueObject. Create a concrete ValueObject implementing ValueObjectInterface and job is done... Or not You can't accept all ValueObject for find so you will write a condition for testing the $id and use or throw an InvalidArgumentException.
So my advice (after 17 months) is: Do you want to create a DDD project? If yes, follow the rules of this package and you will create a DDD project but you should not implement this in your project.
Contributing
This project is a work in progress so don't hesitate to see CONTRIBUTING file and submit your PR.
Credits
This README is heavily inspired by Hateoas library by the great @willdurand. This guy needs your PR for the sake of the REST in PHP.
Alexandre "pocky" Balmes [email protected]. Send me Flattrs if you love my work, buy me gift or hire me!
License
DDD in PHP
is released under the MIT License. See the bundled LICENSE file for details.