All Projects → fabwu → dddinaction

fabwu / dddinaction

Licence: MIT license
PHP implementation of the DDD in Practice Pluralsight course

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to dddinaction

standard-projections
Standard projections to use with Prooph EventStore
Stars: ✭ 14 (-71.43%)
Mutual labels:  ddd
IEManageSystem
基于 Asp.net core + React + ReactNative 的 可视化编辑,所见即所得 的 CMS,具有 浏览器 和 App 两个前端
Stars: ✭ 51 (+4.08%)
Mutual labels:  ddd
hollywood
Hollywood-js is a Framework for building very modular and high scalable server side applications following CQRS (Command Query Responsibility Segregation) and enforcing IoC.
Stars: ✭ 20 (-59.18%)
Mutual labels:  ddd
MiCake
🍰一款基于.Net Core平台的“超轻柔“领域驱动设计(DDD)组件
Stars: ✭ 112 (+128.57%)
Mutual labels:  ddd
pdo-snapshot-store
PDO Snapshot Store
Stars: ✭ 24 (-51.02%)
Mutual labels:  ddd
Wilson
ERP / CRM system for small to medium construction companies.
Stars: ✭ 84 (+71.43%)
Mutual labels:  ddd
micro
Functional prooph for microservices
Stars: ✭ 53 (+8.16%)
Mutual labels:  ddd
Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application.
Stars: ✭ 30 (-38.78%)
Mutual labels:  ddd
aggregate-persistence-sample
No description or website provided.
Stars: ✭ 25 (-48.98%)
Mutual labels:  ddd
spring-data-ldap
Repository abstraction for Spring LDAP
Stars: ✭ 53 (+8.16%)
Mutual labels:  ddd
DDD
Domain-Driven Design is a software development approach in which it utilizes concepts and good practices related to object-oriented programming.
Stars: ✭ 51 (+4.08%)
Mutual labels:  ddd
food-ordering-demo
Demo application focusing on the Food Ordering domain - Used in our video series
Stars: ✭ 28 (-42.86%)
Mutual labels:  ddd
eventsourcing-java-example
A simplified (in memory) example of Event Sourcing implementation for banking domain.
Stars: ✭ 83 (+69.39%)
Mutual labels:  ddd
Clean-Architecture-Template
Configurable Clean Architecture template containing the DDD + CQRS approach for .NET Core applications.
Stars: ✭ 14 (-71.43%)
Mutual labels:  ddd
DDDToolbox
A set of Roslyn refactorings supporting DDD design
Stars: ✭ 31 (-36.73%)
Mutual labels:  ddd
typescript-ddd-example
🔷🎯 TypeScript DDD Example: Complete project applying Hexagonal Architecture and Domain-Driven Design patterns
Stars: ✭ 607 (+1138.78%)
Mutual labels:  ddd
order-taking
Idris version of Domain Modeling Made Functional Book.
Stars: ✭ 113 (+130.61%)
Mutual labels:  ddd
NStore
Opinionated eventsourcing library
Stars: ✭ 81 (+65.31%)
Mutual labels:  ddd
teamo-ddd-example
Implementing Domain Driven Design in PHP using Laravel
Stars: ✭ 46 (-6.12%)
Mutual labels:  ddd
go-todo-app
Go + Angular Todo App
Stars: ✭ 21 (-57.14%)
Mutual labels:  ddd

DDD Snack Machine

Build Status

This is a simple snack machine implemented in PHP and following the Domain Driven Design principles. Everything is based on the Pluralsight course Domain Driven Design in Practice. You can find the original C# source code here.

The repository contains the following branches each reflecting a module in the course:

  • module-2 Starting with the First Bounded Context
  • module-3 Introducing UI and Persistence Layers
  • module-5 Extending the Bounded Context with Aggregates & Introducing Repositories
  • module-6 Introducing the Second Bounded Context
  • module-7 Working with Domain Events

I couldn't implement everything exactly like Vladimir suggested it. Here is a list of things I had to adapt for the PHP language:

  • I stored the snack machine with both money value types in the database. As a first approach I used sessions to overcome the state problem but this seems a bit like a overkill so I stored everything in the database. Therefore, I have to read and save the snack machine after each action but I couldn't come up with a better solution.
  • I didn't have to break encapsulation or add new constructors because Doctrine discover the properties via reflection and can create the proxies.
  • I had to use annotations to describe the orm mapping. I don't really like them because they clutter up my entities with persistence logic but the other options (xml, yml, php) don't provide refactoring or auto-completion.
  • Doctrine doesn't support entities on embeddables so I just use the id as an integer column.
  • The domain events implementation is inspired from this blogpost. I tried to use a more type save approach but it's still ugly due to the php type system. You also have to register all domain events handler manually. A compiler pass collects all tagged handlers and adds them to the dispatcher.

I also tried to encapsulate the modules via composer's path setting. This was not useful because it provides no encapsulation (e.g. Domain module can access UI module) and slows down development.

Installation

Run the following commands to install and start the server.

composer install
php bin/console doctrine:migrations:migrate
php -S localhost:8080 -t public/

You can then access the application under http://localhost:8080

Testing

Run the tests with the following command:

# Unit Tests
vendor/bin/phpunit --configuration phpunit.xml --testsuite unit

# Integration Tests
vendor/bin/phpunit --configuration phpunit.xml --testsuite integration
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].