You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to show the PHP way of implementing DomainDriven Design with the help of
23
-
the originial Cargo sample used in Eric Eveans book
24
-
`DomainDriven Design: Tackling Complexity in the Heart of Software`.
13
+
We want to show the PHP way of implementing Domain-Driven Design with the help of
14
+
the original Cargo sample used in Eric Evans book
15
+
`Domain-Driven Design: Tackling Complexity in the Heart of Software`.
25
16
This has already been done using java and a C# version is also available.
26
17
The sample is not meant to be as the one and only way. It should help you understand the theory
27
18
and gives you a starting point. Also see the [Caveats](http://dddsample.sourceforge.net/) of the
@@ -32,33 +23,16 @@ Iterative Implementation
32
23
To go with you when you read the book, our sample has a [release of each chapter](https://github.com/codeliner/php-ddd-cargo-sample#chapter-overview). So you can
33
24
simply `git checkout ChapterOne` and you only get the starting view of the domain
34
25
with just to entities `Cargo` and `Voyage`. Our application evolves chapter by chapter
35
-
the more knowledge we get about the domain. You can find a list of all available chapters below.
36
-
37
-
Behavior Driven Design
38
-
----------------------
39
-
All features of the application are described in feature files. You can find them in
40
-
the [features folder](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/features) of the project.
41
-
We make use of [Behat](http://behat.org/) and [Mink](http://mink.behat.org/) to test our
42
-
business expectations.
43
-
44
-
Unit Tests
45
-
----------
46
-
Unit Tests are of course also available. You can find them in [module/Application/tests/PHPUnit](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/module/Application/tests/PHPUnit).
47
-
Got to the directory and simply run `phpunit`.
48
-
49
-
Project Structure
50
-
-----------------
51
-
There is no problem if you don't know the structure of a ZF2 application. All the important
52
-
parts like the domain and the infrastructure implementation can be found in the [namespace](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/module/Application/src/Application) of the application module.
26
+
the more knowledge we get about the domain. Each chapter ships with it's own review, where you can find additional information about the implementation, tips and tricks and many more.
53
27
54
28
Chapter Overview
55
29
----------------
56
30
57
31
###ChapterOne
58
32
`git checkout ChapterOne`
59
33
60
-
Chapter One release contains the first draft of the Cargo DDD model.
61
-
It contains the Entities `Cargo` and `Voyage` and also an `Application BookingService` that works with an `overbooking policy`
34
+
Chapter One release contains the first draft of the Cargo DDD model.
35
+
It contains the Entities `Cargo` and `Voyage` and also an `Application BookingService` that works with an `overbooking policy`
62
36
to allow the booking of a Cargo even when the Voyage has not enough free capacity.
> "Design a portion of the software system to reflect the domain model in a very literal way, so that
52
+
> mapping is obvious. Revisit the model and modify it to be implemented more naturally in software,
53
+
> even as you seek to make it reflect deeper insight into the domain. Demand a single model that
54
+
> serves both purposes well, in addition to supporting a robust UBIQUITOUS LANGUAGE.
55
+
> Draw from the model the terminology used in the design and the basic assignment of responsibilities.
56
+
> The code becomes an expression of the model, so a change to the code may be a change to the
57
+
> model. Its effect must ripple through the rest of the project's activities accordingly."
58
+
>
59
+
> -- Eric Evans: Domain-Driven Design: Tackling Complexity in the Heart of Software
60
+
61
+
Project Structure
62
+
-----------------
63
+
There is no problem if you don't know the structure of a ZF2 application. All the important
64
+
parts like the domain and the infrastructure implementation can be found in the [namespace](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/module/Application/src/Application) of the application module.
65
+
66
+
Behavior Driven Design
67
+
----------------------
68
+
All features of the application are described in feature files. You can find them in
69
+
the [features folder](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/features) of the project.
70
+
We make use of [Behat](http://behat.org/) and [Mink](http://mink.behat.org/) to test our
71
+
business expectations.
72
+
73
+
Unit Tests
74
+
----------
75
+
Unit Tests are of course also available. You can find them in [module/Application/tests/PHPUnit](https://github.com/codeliner/php-ddd-cargo-sample/tree/master/module/Application/tests/PHPUnit).
76
+
Got to the directory and simply run `phpunit`.
77
+
72
78
Support
73
79
-------
74
80
If you have any problems with the application please let me know and send me an email `kontakt[at]codeliner[dot]ws` or open a [GitHub issue](https://github.com/codeliner/php-ddd-cargo-sample/issues?state=open).
75
81
Same applies if you have a question or a feature wish.
76
82
Maybe I've missed a concept that you hoped to find in the example.
77
83
84
+
Acknowledgement
85
+
---------------
86
+
This project is work in progress. Your welcome to fork the repo and help finishing the cargo sample application for php.
87
+
The application layer is based on ZF2 and we use Doctrine2 to persist our aggregates.
88
+
This would be a common combination in a large PHP project but both frameworks are not required. They just make our life easier
89
+
and let us focus on the Domain-Driven Design implementation. Both can be replaced with any other PHP based components.
90
+
91
+
The original cargo sample written in java can be found [here](http://dddsample.sourceforge.net/).
Copy file name to clipboardExpand all lines: docs/ChapterTwo-Review.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You can follow the decisions by browsing through the [issues of ChapterTwo](http
9
9
10
10
Value of using an Ubiquitous Language
11
11
-------------------------------------
12
-
We don't want repeat Eric Eveans here. Please read his book for detailed information. The team has changed many method names to better reflect the Ubiquitous Language. This is especially true for all PHPUnit test methods. The team switched to a behavior naming convention for test methods. See [issue #13](https://github.com/codeliner/php-ddd-cargo-sample/issues/13) for details.
12
+
We don't want repeat Eric Evans here. Please read his book for detailed information. The team has changed many method names to better reflect the Ubiquitous Language. This is especially true for all PHPUnit test methods. The team switched to a behavior naming convention for test methods. See [issue #13](https://github.com/codeliner/php-ddd-cargo-sample/issues/13) for details.
13
13
In addition all getter methods were renamed. It is a rule of thumb that you should avoid the usage of `getProperty` and `setProperty` methods in domain model classes. Find more expressive names to reflect the Ubiquitous Language. For simple property getters that means `$entity->property()` is quite enough cause there is no public setter pendant. Instead you define a use case specific method that changes the property of the entity while processing the use case `$entity->doSomethingThatChangesProperty()`.
0 commit comments