ferrius / ddd-cqrs-example Goto Github PK
View Code? Open in Web Editor NEWDDD CQRS ADR PHP Symfony example
License: GNU General Public License v3.0
DDD CQRS ADR PHP Symfony example
License: GNU General Public License v3.0
Hi,
I have a design-related question, As I know about DDD and some sources I read, most people indicate separations between domain and persistence (or infrastructure in general). Most people use Doctrine ORM when they consider the DDD approach in PHP, domain models (or Entities) are a part of domain, so they have no idea about persistence.
Let's imagine we have an Author
domain model that publishes posts
, I thought below code:
class Post
{
public function __construct(
protected Author $author,
protected PostTitle $title,
protected PostContent $content,
protected DateTimeImmutable $publishedAt
) {}
}
class Author
{
public function __construct(
protected AuthorEmail $email,
protected array $posts = []
) {}
public function publishNewPost(Post $post)
{
$this->posts []= $posts;
}
}
I fact, what I want is I could use the Post
and Author
classes as domain models without any persistence concern (doctrine annotations/ArrayCollection class/...). I'd like to separate Doctrine's entity from domain models and I don't know what should I do. Could you help me, please?
On macosx (zsh) setup_envs.sh fails with error
sed: 1: ".env.local": invalid command code .
In this SO https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed recommended to add '' -e
after sed -i
in case when sed commandd fails on period (like .env.local I suppose).
I fixed this in this way (for all sed's) and this working wor me:
sed -i '' -e "s/^APP_ENV=.*/APP_ENV=${APP_ENV}/g" .env.local && \
...
Can you test it on linux and apply patch if it also works fine?
I thing there is flow control layer missing. Any ideas how it could be handled?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.