-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Building Conduit" book suggestions #5
Comments
@andreapavoni Ecto changesets aren't used because the write model, which accepts commands, persists its state via domain events appended to an event store. There's a separate read model which later projects these events into the database using There's an example of enforcing uniqueness in the Conduit sample repo on GitHub. The approach is to build a read model projection containing the unique values which is populated from your domain events. You query this projection as part of command validation to ensure the value has not already been used.
Does that make it any clearer for you? |
@slashdotdash thanks for the quick reply! I've deleted my comment few minutes after I wrote it because I've seen later in the book some clever workarounds for username/email uniqueness, by using a GenServer to claim/reserve the data. I'm going to check the part about articles and slugs. Thank you again! |
On page 30 (Accounts > Register a user > Constructing commands from external data) adding the def application do
[applications: [:exconstructor]]
end https://hexdocs.pm/exconstructor/ExConstructor.html Thanks! |
Hi guys, Is there an example of value-object in this tutorial? I was using the Conduit tutorial as the main guide. However, in that example, it does not mention how to represent value-object and how we can associate them with entities. It seems that they are just using entities for everything. Could someone support me? Thanks! |
Not sure if this is the best place, but really enjoying the book. I found one issue in "Building Conduit", that's not a big deal but might help someone else. The UserRegistered event module needs to be created and aliased in order for iex to start, as in the examples a few paragraphs earlier. |
Edits/suggestions for the book, Building Conduit. Have an edit or suggestion? Leave a comment here!
Edits
defmodule Conduit.Accounts.UserTest
should beConduit.Accounts.Aggregates.UserTest
Conduit.Validations.Validators.String
— the namespacing for validators changes over the course of a couple commits, and the examples in the book do not matchSuggestions
Conduit.Storage.reset!
for tests is not mentioned in the book, but relied upon in the examplesfixture(:user)
in favor ofuser_fixture()
. This dealt with issues users were having once tests expanded beyond the most simple case.The text was updated successfully, but these errors were encountered: