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

Invalid twig syntax + grammar #49

Closed nicoSWD closed 8 years ago

nicoSWD commented 8 years ago

In section 2.2.2.2 The View, it should read:

{% endfor %}

Instead of:

{% endforeach %}

2.3.1 The Dependency Inversion Principle (DIP)

This:

But then, what is Hexagonal Architecture?, and how does it fit within of all this?

Should read:

But then, what is Hexagonal Architecture, and how does it fit within of all of this?

Or:

But then, what is Hexagonal Architecture? And how does it fit within of all of this?

2.3.2 Applying Hexagonal Architecture

$post = Post::writeNewFrom($title, $content);

Maybe it's just me, but the naming feels a little weird. Why does it appear to "write" a new "form", but is returning an instance of Post? Wouldn't Post::create, or as of PHP 7, Post::new be more appropriate?

2.4 Command Query Responsibility Segregation

This strict separation triggers another problem, Eventual Consistency.

I would rephrase this to:

This strict separation causes another problem: Eventual Consistency.

You used the word "triggers" in the sentence prior to this one, and it feels a little out of place here.

And that's it for today. Will continue reading in the upcoming days. I understand you're having the book professionally reviewed, so should I keep focusing on things like grammar, or should I concentrate mainly on the technical parts?

theUniC commented 8 years ago

Thanks Nico! :)

I've fixed all except the Post::writeNewFrom.

To my understand, the name writeNewFrom is much more aligned with the Ubiquitous Language than create or simply new, since when you want to publish a blog post you have to first write it. The Blog Post example it's maybe a simple example, but I think that named constructors should strictly follow the Ubiquitous Language.

Christian.

nicoSWD commented 8 years ago

Thanks for the explanation, Christian! Fair enough, I'll accept that as an answer. :)