Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Domain-Driven Design
  3. Eric Evans DDD Cargo Sample

Eric Evans DDD Cargo Sample

BSD-3-ClauseJavaScriptChapterFour

A PHP 7 implementation of the cargo shipping domain from Eric Evans' Domain-Driven Design book, demonstrating tactical DDD patterns.

Visit WebsiteGitHubGitHub
791 stars101 forks0 contributors

What is Eric Evans DDD Cargo Sample?

PHP DDD Cargo Sample is a reference implementation of the cargo shipping domain from Eric Evans' Domain-Driven Design book, built with PHP 7. It demonstrates how to apply DDD tactical patterns—like aggregates, entities, and value objects—in a modern PHP application to manage complex business logic in the shipping industry.

Target Audience

PHP developers and software architects learning or applying Domain-Driven Design, particularly those seeking a concrete, working example of DDD patterns in PHP with modern frameworks and tools.

Value Proposition

Developers choose this project because it provides a complete, well-structured PHP 7 implementation of a classic DDD case study, using up-to-date technologies like Zend Expressive and Doctrine ORM. It bridges the gap between DDD theory and practice, offering tested, educational code rather than just theoretical concepts.

Overview

PHP 7 Version of the cargo sample used in Eric Evans DDD book

Use Cases

Best For

  • Learning Domain-Driven Design tactical patterns in PHP
  • Reference implementation for DDD aggregates and value objects
  • Studying integration of Doctrine ORM with DDD concepts
  • Example of Behavior-Driven Design with Behat in PHP
  • Modern PHP 7 application architecture with middleware
  • Educational resource for DDD workshops or training

Not Ideal For

  • Production teams needing a turnkey solution with built-in authentication, error handling, and long-term support
  • Developers seeking a lightweight MVC framework without the complexity of DDD aggregates and value objects
  • Projects running on PHP versions older than 7 or requiring PHP 8+ compatibility out of the box
  • Teams unfamiliar with Domain-Driven Design who prefer conventional, rapid application development patterns

Pros & Cons

Pros

Modern PHP Standards

Uses PHP 7 strict type hints and PSR-7/15 middleware with Zend Expressive, ensuring code clarity and interoperability, as highlighted in the 'What Is New?' section of the README.

Practical DDD Implementation

Demonstrates DDD tactical patterns like aggregates and value objects with Doctrine ORM embeddables, providing a concrete reference to translate theory into working code.

Behavior-Driven Testing

Features are described and tested with Behat and Mink, validating business expectations directly, as shown in the 'Behavior Driven Design' section with example feature files.

Educational Reference

Offers a complete, annotated project structure and documentation, making it an effective learning resource for DDD workshops or self-study in PHP.

Cons

Outdated Technology Stack

Based on PHP 7 and older versions of Zend Expressive and Doctrine, which may lack compatibility with current PHP 8+ ecosystems and security updates, limiting modern adoption.

Complex Setup for Beginners

Requires running a selenium server for Behat tests and has multiple installation steps, as noted in the documentation, which can be cumbersome for those new to the toolchain.

Limited Production Readiness

Admitted as an educational reference with caveats from the original Java version, missing features like authentication, scalability, and error handling needed for real-world use.

Frequently Asked Questions

Quick Stats

Stars791
Forks101
Contributors0
Open Issues0
Last commit7 years ago
CreatedSince 2013

Tags

#doctrine-orm#educational#domain-driven-design#php7#phpunit#ddd#php#reference-implementation#ddd-patterns

Built With

B
Behat
P
PSR-7
P
PHPUnit
D
Doctrine ORM

Links & Resources

Website

Included in

Domain-Driven Design12.2k
Auto-fetched 7 hours ago

Related Projects

BroadwayBroadway

Infrastructure and testing helpers for creating CQRS and event sourced applications.

Stars1,510
Forks170
Last commit3 months ago
Symfony 5 DDD ES CQRS backendSymfony 5 DDD ES CQRS backend

Symfony 7 DDD ES CQRS backend boilerplate.

Stars1,090
Forks186
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub