PHPackages                             black/ddd-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. black/ddd-php

AbandonedArchivedLibrary

black/ddd-php
=============

Implements DDD in PHP

v2.0.0(11y ago)221784MITPHPPHP &gt;=5.4.0

Since Aug 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/black-project/ddd-php)[ Packagist](https://packagist.org/packages/black/ddd-php)[ Docs](http://www.lablackroom.com)[ RSS](/packages/black-ddd-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (8)Used By (0)

DDD PHP
=======

[](#ddd-php)

**DDD in PHP** is a simple project (a folder structure) for your project build with [Domain Driven Design](http://dddcommunity.org/).

[![Latest Stable Version](https://camo.githubusercontent.com/7859563143cf51b09878fff4d76207fce4ef44c5ad34723b08640b2939350dc9/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2f6464642d7068702f762f737461626c652e706e67)](https://packagist.org/packages/black/ddd-php)[![Total Downloads](https://camo.githubusercontent.com/a9260d8a19c17e4ac772b589d224fcdc9938d17b0260b36bf493ae520900bd3a/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2f6464642d7068702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/black/ddd-php)

Installation
------------

[](#installation)

The recomanded way to install DDD in PHP is through [Composer](http://getcomposer.org/):

```
{
    "require": {
        "black/ddd-php": "@stable"
    }
}
```

**Protip:** You should browse the [`black/ddd-php`](https://packagist.org/packages/black/ddd-php) page to choose a stable version to use, avoid the `@stable` meta constraint.

Why?
----

[](#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
-----

[](#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?
----------------------------------------------------

[](#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
------------

[](#contributing)

This project is a work in progress so don't hesitate to see CONTRIBUTING file and submit your PR.

Credits
-------

[](#credits)

This README is heavily inspired by [Hateoas](https://github.com/willdurand/Hateoas) library by the great [@willdurand](https://github.com/willdurand). This guy needs your [PR](http://williamdurand.fr/2014/07/02/resting-with-symfony-sos/) for the sake of the REST in PHP.

Alexandre "pocky" Balmes . Send me [Flattrs](https://flattr.com/profile/alexandre.balmes) if you love my work, [buy me gift](http://www.amazon.fr/registry/wishlist/3OR3EENRA5TSK) or hire me!

License
-------

[](#license)

`DDD in PHP` is released under the MIT License. See the bundled LICENSE file for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~41 days

Total

7

Last Release

4127d ago

Major Versions

v1.2.3 → v2.0.02015-01-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/86a3a03b53a62ac6bea9885beb48980a4a57dda70e36dc8828d0ececec05a738?d=identicon)[pocky](/maintainers/pocky)

---

Top Contributors

[![pocky](https://avatars.githubusercontent.com/u/204451?v=4)](https://github.com/pocky "pocky (21 commits)")

---

Tags

librarydddblack-project

### Embed Badge

![Health badge](/badges/black-ddd-php/health.svg)

```
[![Health](https://phpackages.com/badges/black-ddd-php/health.svg)](https://phpackages.com/packages/black-ddd-php)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
