PHPackages                             andrzejkupczyk/ddd-generic-subdomain - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. andrzejkupczyk/ddd-generic-subdomain

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andrzejkupczyk/ddd-generic-subdomain
====================================

Interfaces supporting coherent implementation of DDD components

12492PHP

Since Feb 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/andrzejkupczyk/ddd-generic-subdomain)[ Packagist](https://packagist.org/packages/andrzejkupczyk/ddd-generic-subdomain)[ RSS](/packages/andrzejkupczyk-ddd-generic-subdomain/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (2)

Domain-Driven Design generics
=============================

[](#domain-driven-design-generics)

[![PHP requirement](https://camo.githubusercontent.com/7866bfdb9884206ef41b9302dbb4fc39b9a16463a73840eca09e8a3bdf0abe89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616e64727a656a6b7570637a796b2f6464642d67656e657269632d737562646f6d61696e3f6c6f676f3d706870267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/7866bfdb9884206ef41b9302dbb4fc39b9a16463a73840eca09e8a3bdf0abe89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616e64727a656a6b7570637a796b2f6464642d67656e657269632d737562646f6d61696e3f6c6f676f3d706870267374796c653d666f722d7468652d6261646765)

This package provides interfaces that can be used to support coherent implementation of DDD components within your core domain. It is intended to be used as an off-the-shelf solution that helps to avoid clogging up a domain model and to force members of your team or yourself on thinking in terms of immutable objects and their interaction.

All implementations are inspired by literature, ValueObject library created by [Nicolò Pignatelli](https://github.com/nicolopignatelli), [SeedStack](http://seedstack.org) Java development stack, [ValueObjects toolkit](https://github.com/barryosull/valueobjects)and some other, more direct sources, but mainly by my experiences and needs.

Components
----------

[](#components)

Documentation is for the weak, but there is some useful information in the code.

### [Value Object](src/ValueObject/ValueObject.php)'s Immutability

[](#value-objects-immutability)

The `ValueObject` interface represents an immutable object that have no identity, however immutability is not guaranteed in PHP. Currently, the only way of achieving immutability is through encapsulation, therefore you can use `ImmutableValueObject` proxy class.

```
$year = new ImmutableValueObject(new Year(2020));
// or, using a helper function
$year = immutable(new Year(2020));
```

A proxied value object acts as a substitute for a real one, but at the same time it gives more confidence regarding its immutability.

Finally, you can also use [Psalm](https://psalm.dev/articles/immutability-and-beyond).

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

[](#installation)

Using Composer:

```
composer require andrzejkupczyk/ddd-generic-subdomain

```

Example usages
--------------

[](#example-usages)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ff3e1c0c98bc1309d674447346f18f7da7ceb799c79cc524d68d23c5d6b27b?d=identicon)[andrzejkupczyk](/maintainers/andrzejkupczyk)

---

Top Contributors

[![andrzejkupczyk](https://avatars.githubusercontent.com/u/11018286?v=4)](https://github.com/andrzejkupczyk "andrzejkupczyk (3 commits)")

---

Tags

aggregateaggregate-rootdomain-driven-designentityrepositoryvalue-object

### Embed Badge

![Health badge](/badges/andrzejkupczyk-ddd-generic-subdomain/health.svg)

```
[![Health](https://phpackages.com/badges/andrzejkupczyk-ddd-generic-subdomain/health.svg)](https://phpackages.com/packages/andrzejkupczyk-ddd-generic-subdomain)
```

###  Alternatives

[fresns/fresns

Cross-platform general-purpose multiple content forms social network service software.

4841.5k](/packages/fresns-fresns)[nilportugues/php_todo

Looks into the code using a user-defined list of to-do phrases and stops commit if the total amount increased or is above a threshold.

1210.0k](/packages/nilportugues-php-todo)

PHPackages © 2026

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