dddshelf / ddd-in-php-book-issues

Leave your comments, improvements or book mistakes as an issue! Thanks ❤️
https://leanpub.com/ddd-in-php
28 stars 2 forks source link

Suggestions and fixes for chapter 3 #57

Closed nicoSWD closed 8 years ago

nicoSWD commented 8 years ago

3.4.6 Side-Effect-Free Behavior

3.6 Testing Value Objects

3.7.1.1 Embedded Value with an Ad Hoc ORM

This reads a little weird:

If using an ad hoc ORM Repository based on DBAL, the DbalProductRepository, you should take care to create the INSERT statement, bind the parameters, and execute it:

I would perhaps rephrase it to something like:

If you're using an ad hoc ORM Repository based on DBAL, (let's call it DbalProductRepository), you must take care of creating the INSERT statement, binding the parameters, and executing it:

More than one creation ocurrs

... subsequent creation creations occur

I think it reads a little nicer this way:

... the space required to persist the Entity is just what is what's required

The creation of the aggregate

... fire an Event in the constructor if your Domain is interested in the Aggregates Aggregate's creation

Or:

... fire an Event in the constructor if your Domain is interested in Aggregate creations

Or:

... fire an Event in the constructor if your Domain is interested in the creation of Aggregates

...

... that extends from the Product Entity and that is able to reconstitute the Entity from the database

Or:

... that extends from the Product Entity and that is able to reconstitute itself from the database

... ?

I know what you mean by "in this instance", but the last thing you mentioned before that is "giving Doctrine a try". So I first assume that's what you're referring to.

Besides, in this instance, you need to create a DbalProduct Entity that extends from the Product Entity and is able to reconstitute the Entity from the database without using the new operator, instead using a static factory method.

I would say something in the lines of:

Besides, when creating your own ORM, you also need to create a DbalProduct Entity that extends from the Product Entity, that is able to reconstitute itself from the database using a static factory method instead of the new operator.

3.7.1.2 Embedded Value (Embeddables) with Doctrine >= 2.5.

Doctrine stable release is currently 2.5 ... -> The latest stable Doctrine release is currently version 2.5 ...

Aaaand that's all, folks! (For today)

nicoSWD commented 8 years ago

Small bonus issue:

On page 340 it says "behaviour" (British English) whereas the rest of the book is using the American English version, "behavior".

keyvanakbary commented 8 years ago

Hey Nico, thanks a lot for your contribution! 👏

I've included most of your suggestions. The otherMethod issue was actually correct because we were pointing out the otherMethod call inside that one. However, you are right, it was a little bit confusing and we changed it in terms of clarity.

I've also included you under the acknowledgements. Thanks again :)

nicoSWD commented 8 years ago

Hey @keyvanakbary,

just a quick heads up, you've added me twice to the acknowledgements section. :wink:

keyvanakbary commented 8 years ago

😂 Fixed, thanks!