PHPackages                             ericksonreyes/domain-driven-design - 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. ericksonreyes/domain-driven-design

ActiveLibrary

ericksonreyes/domain-driven-design
==================================

Domain Driven Design Inspired Classes and Interfaces

v2.1.0(5y ago)21332[1 issues](https://github.com/ericksonreyes/domain-driven-design/issues)[1 PRs](https://github.com/ericksonreyes/domain-driven-design/pulls)1MITPHPPHP &gt;=7.2CI failing

Since Apr 13Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ericksonreyes/domain-driven-design)[ Packagist](https://packagist.org/packages/ericksonreyes/domain-driven-design)[ RSS](/packages/ericksonreyes-domain-driven-design/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (10)Versions (11)Used By (1)

Domain Driven Design Classes and Interfaces
===========================================

[](#domain-driven-design-classes-and-interfaces)

A collection of Domain Driven Design inspired Classes and Interfaces.

[![Build Status](https://camo.githubusercontent.com/deb62e70601dccebf1deec0af863ae1257f1b40f4c92664c3fde7d404ac84ce8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](https://travis-ci.org/ericksonreyes/domain-driven-design)[![Code Coverage](https://camo.githubusercontent.com/2fd9e043058a676bddff12d3638e4417c6355dabc8a35168e854ff4da7317247/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](https://coveralls.io/github/ericksonreyes/domain-driven-design?branch=master)[![License](https://camo.githubusercontent.com/fc37633a0d152f8805630ecb3cff9158e7e7a84f683da5e7325bdb9c451a331e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](LICENSE.MD)[![Packagist Version](https://camo.githubusercontent.com/6669ad5cf9ae2618768c9e5afde8a00da0b3f1dc5ed06140da9f0b05aa9ddd66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e7376673f7665723d31)](https://packagist.org/packages/ericksonreyes/domain-driven-design)[![Last Commit](https://camo.githubusercontent.com/616cb8ffa9073c70797c723cb9250333607f4840c2edf73037618764503d3ee5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](https://github.com/ericksonreyes/domain-driven-design/commits/master)[![Stable Version](https://camo.githubusercontent.com/21f5460ae7f8e271c6c84bb3edd484fc1aaa9ab47af93a6bf2afddc1f5a57af7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e7376673f7665723d31)](https://github.com/ericksonreyes/domain-driven-design/tags)[![PHP Version](https://camo.githubusercontent.com/4346c61837bb177f97aebdae89dc3105305e029be1a6e26227ae8bba2db6052e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](https://github.com/ericksonreyes/domain-driven-design/tags)[![Downloads](https://camo.githubusercontent.com/371e7e7abd36a6cd24f0917f6e6d6e03aa56c007dc2eb904d0fe0d70323b2264/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2f746f74616c2e737667)](https://github.com/ericksonreyes/domain-driven-design/tags)[![Installations](https://camo.githubusercontent.com/b2e61e86b72c26fdc5115b3c3afc6a923403e1936d808ea18b48931915c02b84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f657269636b736f6e72657965732f646f6d61696e2d64726976656e2d64657369676e2e737667)](https://packagist.org/packages/ericksonreyes/domain-driven-design)

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

[](#installation)

```
composer require ericksonreyes/domain-driven-design
```

Usage
-----

[](#usage)

- [Command Bus](docs/application/COMMAND_BUS.MD)
- [Event Bus](docs/application/EVENT_BUS.MD)
- [Class Composition Validator](docs/common/validation/CLASS_COMPOSITION_VALIDATOR.MD)

Value Objects
-------------

[](#value-objects)

- [Identifier](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Identifier.php)
- [Currency](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Currency.php)
- [Email Address](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/EmailAddress.php)
- [Money](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Money.php)
- [Full Name](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Person/FullName.php)
- [Name Title](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Person/Title.php)
- [Person Name](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Person/Name.php)
- [Name Suffix](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Person/Suffix.php)
- [Address](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/Address.php)
- [Street](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/Street.php)
- [City](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/City.php)
- [State](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/State.php)
- [Country Code](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/CountryCode.php)
- [Zip Code](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/Address/ZipCode.php)
- [File](src/EricksonReyes/DomainDrivenDesign/Common/ValueObject/File.php)

Examples
--------

[](#examples)

- [Domain Entity](src/EricksonReyes/DomainDrivenDesign/Example/Domain/DomainEntity.php)
- [Domain Event](src/EricksonReyes/DomainDrivenDesign/Example/Domain/DomainEntityWasDeletedEvent.php)
- [Event Sourced Domain Entity](src/EricksonReyes/DomainDrivenDesign/Example/Domain/EventSourcedDomainEntity.php)
- [File Attaching Domain Entity](src/EricksonReyes/DomainDrivenDesign/Example/Domain/FileAttachingDomainEntity.php)

Interfaces
----------

[](#interfaces)

- [Command Bus](src/EricksonReyes/DomainDrivenDesign/Infrastructure/CommandBus.php)
- [Event Bus](src/EricksonReyes/DomainDrivenDesign/Infrastructure/EventBus.php)
- [Event Handler](src/EricksonReyes/DomainDrivenDesign/Infrastructure/EventHandler.php)
- [Event Publisher](src/EricksonReyes/DomainDrivenDesign/Infrastructure/EventPublisher.php)
- [Event Repository](src/EricksonReyes/DomainDrivenDesign/Infrastructure/EventRepository.php)
- [Exception Handler](src/EricksonReyes/DomainDrivenDesign/Infrastructure/ExceptionHandler.php)
- [Identity Generator](src/EricksonReyes/DomainDrivenDesign/Infrastructure/IdentityGenerator.php)

Abstract Exceptions
-------------------

[](#abstract-exceptions)

- [AuthenticationFailureException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/AuthenticationFailureException.php) - Authentication/Login failed.
- [PermissionDeniedException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/PermissionDeniedException.php) - Authorization failed. No permission to access a record or execute a command.
- [RecordConflictException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/RecordConflictException.php) - Saving an existing record or overwriting a record with state that has been changed.
- [DeletedRecordException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/DeletedRecordException.php) - Accessing or deleting a record that has been deleted already.
- [RecordNotFoundException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/RecordNotFoundException.php) - Accessing or deleting a record that never existed.
- [MissingActionPerformerException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/MissingActionPerformerException.php) - Commands that has no action performer for accountability.
- [EmptyIdentifierException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/EmptyIdentifierException.php) - Entity or aggregate with an empty identifier value.

Exceptions
----------

[](#exceptions)

- [MissingEventReplayMethodException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/MissingEventReplayMethodException.php) - Event sourced entity or aggregate does not have the required event replay method.
- [DomainEventOwnershipException](src/EricksonReyes/DomainDrivenDesign/Common/Exception/DomainEventOwnershipException.php) - Replaying an event that does not belong to the entity or aggregate.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

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 ~60 days

Recently: every ~96 days

Total

9

Last Release

2107d ago

Major Versions

v1.2.1 → v2.0.02020-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/1decea575726ca298dcad75c9f11bdfac28700389103cd5103777f4635d588be?d=identicon)[ericksonreyes](/maintainers/ericksonreyes)

---

Top Contributors

[![ericksonreyes](https://avatars.githubusercontent.com/u/841321?v=4)](https://github.com/ericksonreyes "ericksonreyes (48 commits)")

---

Tags

domain-driven-designevent-sourcingphp7

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ericksonreyes-domain-driven-design/health.svg)

```
[![Health](https://phpackages.com/badges/ericksonreyes-domain-driven-design/health.svg)](https://phpackages.com/packages/ericksonreyes-domain-driven-design)
```

PHPackages © 2026

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