calculation-example's People
calculation-example's Issues
Move general DDD question so separate repository
Though there is a great DDD Google group:
https://groups.google.com/forum/#!forum/dddcqrs
I would like to add some tutorials to my blog later:
http://blog.webdevilopers.net/category/php/ddd/
Until then I would like to start some general discussion about DDD with Symfony and Doctrine and put it here:
https://github.com/webdevilopers/php-ddd/blob/master/README.md
Is there any way to move issues between repos on github @yvoyer ?
DDD factory methods vs. CQRS handlers
Actually @yvoyer I don't understand this part enough yet.
In my example:
https://gist.github.com/yvoyer/a778ac744ddf10012864#file-dormercalculation-php
you suggested to use a factory method to add my a price - see lines 44 to 47.
ATM I have a similar scenario. A Customer
( <=> DormerCalculation
) has an Order
( <=> DormerCalculationPrice
).
In my first attempt the Handler created the Order
. The constructor of the Order
required the Customer
.
After a while I thought about your example and read the "Factory method on aggregate root" chapter in the red book. In the example a Forum
adds a Post
/ Discussion
via factory method.
The advantage is too check if the forum wasn't already closed.
My problem is not so much deciding on which technique to choose. It's more about the terminology.
AFAIU "factory methods" are a Domain-Driven Design approach.
But using commands and handlers originally come from the CQRS approach.
Now does the CQRS appraoch recommend to move away the "factory methods" from the Domain Model and put the logic into the Handler - the way I tried in my first attempt?
Curious about your answer!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.