By Developers, For Developers

Historical errata for Domain Modeling Made Functional

PDF PgPaper PgTypeDescriptionFixed onComments
4637TYPO

Small typo at the bottom of the page: “What you call those numbers then?” should be “What do you call those numbers then?”

2017-07-20
51TYPO

In the kindle app for iPad code is not indented so it’s almost useless. The same code in the EPUB version on iBook app looks fine. E.g function isEven in section Function Signatures has all lines aligned on the left.

88ERROR

OrderLine type should have an I’d because it is an entity.

2017-07-20
88ERROR

The PlaceOrder type should have a CustomerId field instead of CustomerInfo as explained on page 85.

2017-07-20
122ERROR

The type for GetProductPrice just under the diagram is missing the dependency on ProductCatalog.

2017-07-20
117TYPO

The diagram at the top of the page displays three states. the third state shows “Paid Card”. It should read: “Paid Cart”

2017-07-20
13ERROR

Command: “Send an order form to Widgets Inc”; corresponding domain event: “Order form received.” -> SHOULD BE corresponding domain event: “Order form sent.”

2017-07-20
119TYPO

The second paragraph refers to a “shopping card” which should be “shopping cart”

2017-07-20
7TYPO

“but it can also a time-based trigger”
“but it can also be a time-based trigger”

2017-07-20
93TYPO

3rd line reads:
“so how do ensure that the constraints are enforced?”

should be:
“so how do you ensure that the constraints are enforced?”

2017-07-20
110TYPO

“Serialization DTOs” section - first sentence: “or whatever format you perfer.” should be “or whatever format you prefer.”

2017-07-20
113TYPO

Second line from the top. “understanding of the workdlow” should be “understanding of the workflow”.

2017-07-20
150TYPO

At the beginning of second paragraph after the bullet list, the sentence starts… “Here’s an example of how want our code to look like” and it should probably say “Here’s an example of how we want our code to look”

2017-07-20
170TYPO

In the final sentence of the second paragraph under the “The complete pipeline” heading. The sentence “At the very bottom, we’ll assemble the steps them into the main function.” should probably be “At the very bottom, we’ll assemble the steps into the main function.”

2017-07-20
183TYPO

First bullet point, second sentence says: “The output is a new two-track-only function, represented as a lambda which has a two-track and a two-track output.”. It should say “The output is a new two-track-only function, represented as a lambda which has a two-track input and a two-track output.”

2017-07-20
39ERROR

On the flow chart, product catalog and address validation are reversed from the text.

2017-07-20
7TYPO

Error with second word in the following sentence :

This is turn meant that they could communicate very effectively with the traders, due to the shared mental model,
and build exactly what their domain experts (the traders) wanted.

2017-07-20
35SUGGEST

The Command: “Provide Quote” seems to be missing:

other input:
Product catalog

Since the completed qoute needs prices for every product.

2017-07-20
8TYPO

Four places in the book the wording “that that” appears, and I think it should only be one “that”.

Page 8:
“…I aim to show that that functional…”

Page 40:
“… For example, we might later learn that that an Order must have an billing address..”

Page 65:
“…if we want to show that that is a way to use a ‘Payment‘…”

Page 191:
“…For example, say that that we want to trap timeouts…”

2017-07-20
108TYPO

3 lines after title Serializing DTOs

perfer should be prefer

2017-07-20
8TYPO

Context: In event storming, you bring together a variety of people (who understand different parts of the business) for a facilated workshop.

Replace “facilated” with “facilitated”.

2017-07-20
xTYPO

Context: Now, just as with DDD, this book is not intended to be an complete guide to functional programming

Replace “an complete guide” with “a complete guide”.

2017-07-20
12TYPO

Context: “We open the mail every morning, and the customers send in order forms on paper, which we open up an classify as orders or quotes”

Replace “an classify” with “and classify”.

2017-07-20
13TYPO

Context: only when we understand it thoroughly should we can think about how to implement a digital equivalent

Replace “should we can” with either “should we” or “we can”.

2017-07-20
13SUGGEST

Context: “Sometimes, when we look at the whole workflow, and then you can think of what parts would benefit from being digital”, without missing any opportunity."

This sentence sounds weird. Please rephrase it. Also, there’s a mismatched double quote sign in the middle.

2017-07-20
8TYPO

In the Kindle version, footnote looks like this:

http:||eventstorming.comCopyright © 2017, The Pragmatic Bookshelf.

(I replaced slashes with pipes to bypass spam-preventing filter).

2017-11-17
29SUGGEST

You spell “acknowledgment” most of the time, but there are at least four instances where you spell it with an e after the g. For consistency you should stick to the first form.

2017-07-20
29TYPO

Replace “reproducable” with “reproducible”

2017-07-20
38TYPO

Replace “this is would be” with either “this is” or “this would be”.

2017-07-20
38TYPO

Replace “we can we see” with either “we can see” or “we see”. Also, use a comma after ProductCode instead of a period.

Context: “Ok, we can we see that OrderQuantity will need to be a word in the ubiquitous language, along with ProductCode. TotalPrice, etc. ”

2017-07-20
42SUGGEST

Spacing before measurement unit is inconsistent in “The lowest weight is 0.05 kg and the highest is 100kg.”

2017-07-20
45TYPO

“for each subprocesses.” should be “for each subprocess.”

2017-07-20
45TYPO

“For example, the subprocess that categorizes the validates the form”

2017-07-20
45SUGGEST

“a UnvalidatedOrder” and “a InvalidOrder” should use the article “an”.

2017-07-20
50TYPO

“As you can see, the the let keyword”. Replace “the the” with “the”.

This same error happens three more times throughout the book, so use search-and-replace to fix it.

2017-07-20
18SUGGEST

Context: “…one of the most important challenges of a DDD design…”

I suggest replacing “DDD design” with “domain-driven design”, since the last D already stands for “design”.

2017-07-20
8TYPO

First line. “Domain events are the starting point for almost all the of the business pro-” Should be “Domain events are the starting point for almost all of the business pro-”. Minus a “the”

2017-07-20
113TYPO

“might used to do things”, should be “might be used to do things”.

2017-11-12
106TYPO

“Here’s an real-world example”, replace “an” with “a”.

2017-11-12
100SUGGEST

“Not once did we design” should not be in type-writer font.

2017-11-12
79TYPO

“Names, Adresses; Orders, etc,”, replace the semicolon with a comma.

2017-11-12
72TYPO

“an possible failure”, replace “an” with “a”

2017-11-12
73TYPO

“To indicate that function can fail”, missing “a” before “function”.

2017-11-12
69TYPO

“An composable type system”, replace “an” with “a”.

2017-11-12
42TYPO

“So that a unvalidated order”, replace “a” with “an”.

2017-11-12
131SUGGEST

“and being able to control your own SLA”

I don’t know what SLA stands for, please expand the acronym.

2017-11-12
10TYPO

the diagram at the top of page 10 and the text under it do not match. The text refers to “process order” and “ship order” but the diagram shows “place order” and “ship order”

2017-11-12
35-36SUGGEST

perhaps this is overkill but where you describe the data structure Order = …… it might be worth also including the Quote = …. to show how the Quote does not need the Shipping and Billing Address and of course would not have the TotalPrice, as you indeed indicate in the text prior to the data structure example.

Similarly for OrderLine .. . the corresponding QuoteLine is perhaps worth showing to make the distinction very clear.

2017-11-12
44TYPO

on the line “The model is a lot more complicated that we originally thought”, need to replace “that” with “than”

2017-11-12
78SUGGEST

?remotesession=75848559-655b-4891-a1c3-8e8b8f581235&dttm=2017-07-28 15:48&validFor=3600&OT=Whatson&OF=AFTix11-2&OC=WhatsonHi Scott,

On page 78, you have

~
data UnvalidatedOrder =
UnvalidatedCustomerInfo
AND UnvalidatedShippingAddress
AND UnvalidatedBillingAddress
AND list of UnvalidatedOrderLine
~

is “data” supposed to be “type”

But my real point is wouldn’t it be more likely that an order is considered “Unvalidated” if any of it’s components are Unvalidated?

e.g.

~
data Order =
CustomerInfo
AND ShippingAddress
AND BillingAddress
AND list of OrderLine
~

then we would have

~
type CustomerInfo =
| ValidatedCustomerInfo
| UnvalidatedCustomerInfo

type ShippingAddress =
| ValidatedShippingAddress
| UnvalidatedShippingAddress
~

etc.

Then we would need a what of Checking the Order to see if it is Validated or not, that is are any of its parts unvalidated. Can this be expressed in the type definition or does this require a function to return if the order is a validated on or not? How would this look? What is the best way to do this

I guess once you have a ValidatedOrder then you can use the specific type ValidatedOrder

~
type ValidatedOrder =
ValidatedCustomerInfo
AND ValidatedShippingAddress
AND ValidatedBillingAddress
AND list of ValidatedOrderLine
~

Thanks
Derek

87SUGGEST

Hi Scott,

~
RE Async<Result< …,…>>
~

The text talks about requiring a callback, a “continuation” but nothing in the example seems to indicate how to set this callback so that it can be actioned. Or am I missing something?

2017-11-12
105TYPO

“That is, we’d like use the…” -> “That is, we’d like to use the…”

2017-11-12
159SUGGEST

since the description of F# syntax is assuming little or no prior knowledge the example

evens oneToFive // Now run the function

would probably be better served to have the definition of oneToFive beforehand, espcially as someone might jump to this part of the book for a quick language intro.

2017-11-12
189TYPO

“Domain errors should are part of the domain…”
to
“Domain errors are part of the domain…”

2017-11-12
190SUGGEST

Hi Scott,

since your book is not assuming much prior F# knowledge in the para where you say

“In the rest of this chapter, we’re only going to focus on errors that we want to explicitly model as part of the domain. Panics and errors that we don’t want to model should be managed using exceptions in the usual way.”

it might nonetheless be nice to provide some example code of catching an exception that the “top level” I guess this happens at the top of the workflow function? to show the sorts of things that can be done to catch any panics, as otherwise, the user’s application could actually abort which at the very least, we would want to avoid, even if the result is just to print a message in a log.

Derek

2017-11-12
57SUGGEST

The following code example
type Temperature =
| Fahrenheit of int
| Celsius of float

is not so intuitive (Celsius could be int too - coming from the temperature domain).

Why not this:

type FloatOrInt=
| I of int
| F of float

2017-11-12
215TYPO

“bind (a.k.a. flatMap) is a function which lets you chaining together monadic
functions. …”

-> “… lets you chain … ”

2017-11-12
209TYPO

“we can convert it work with Results like this”
Change to
“we can convert it to work with Results like this”

2017-11-12
30TYPO

‘..sounds like a another bounded context’. Remove the ‘a’

:)

2017-11-12
38TYPO

‘It depends of what the’ - swap the ‘of’ with ‘on’.

2017-11-12
45ERROR

The listing for subprocess “ValidateOrder” specifies “ValidatedOrder OR ValidationError”, yet later in the workflow we see InvalidOrder returned for instead of ValidationError.

2017-11-12
105ERROR

Couldn’t it be that two or more aggregates had an important role in an use case and therefore had to be in a single transaction? I read this in another book about DDD and seems fine to me as long as none of the aggregates is corrupted by the others, so that we can rollback the transaction if one of the aggregates fail to be persisted.

2110TYPO

On top of page 10, there is a diagram that shows how the event sourcing board might look like. The diagram contains two business workflow items “Place Order” and “Ship Order”, whereas the paragraph below refers to those business workflow items as “process order” and “ship order”, which is a bit confusing.

2017-11-12
1ERROR

Severity\tCode\tDescription\tProject\tFile\tLine\tSuppression State
Error\t\tUnexpected symbol ‘:’ in definition. Expected incomplete structured construct at or before this point or other token.\tOrderTaking\tC:\\Users\\scott\\source\\repos\\swdddf-code\\src\\OrderTaking\\Boundary.Dto.fs\t118\t
Error\t\tIncomplete structured construct at or before this point in implementation file\tOrderTaking\tC:\\Users\\scott\\source\\repos\\swdddf-code\\src\\OrderTaking\\Boundary.Dto.fs\t126\t

110TYPO

In the topic explaining about CompilationRepresentation the code in the example is [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] and I believe that &lt and &gt should be changed to < and >.

2018-01-24
8TYPO

The text makes the common mistake of treating “which” and “that” as being interchangeable. For example, PDF page 8: “Other people may respond by posting notes summarizing the business workflows which are triggered by these events.” It should say “that are triggered”, not “which are triggered.” This is, unfortunately, one of those grammatical problems that, once you’re aware of it, you can’t not see, so it becomes a distraction when reading. Googling “which vs that” will turn up lots of advice on this topic.

2018-01-01
xiSUGGEST

The preface section “Other Approaches To Domain Modeling” lists cases in which DDD may not be the best choice. The domain in which I work may fit one of these cases, but I don’t understand the descriptions well enough to know for sure. It’d be really really great to have some sort of references to other information that I could look at to learn more about these non-DDD cases and how to approach them.

19TYPO

“it’s important that each bounded context has a clear responsibility”: should be “have”, not “has” (subjunctive mood).

2018-01-01
25SUGGEST

“We’ve now got an overview of the problem and an outline of a solution, but we have still got many questions” => “We now have an overview of the problem and an outline of a solution, but we still have many questions” (reads smoother)

2018-01-01
48TYPO

“a good practice is build the system” -> “a good practice is to build the system”

2018-01-01
50TYPO

“an event used for communication between contexts will not just be a simple signal” -> “an event used for communication between contexts will not be just a simple signal”

2018-01-01
52SUGGEST

“share some common domain design, and so the teams” -> “share some domain design, so the teams” (reads smoother)

2018-01-01
52SUGGEST

“must only be done in consultation” -> “must be done only in consultation” (misplaced ‘only’)

2018-01-01
59SUGGEST

“to only access a database, say, at the start or end of a workflow, but not inside the workflow” -> “to access a database, say, only at the start or end of a workflow, not inside the workflow” (misplaced ‘only’, unnecessary ‘but’)

2018-01-01
59SUGGEST

“the core domain model is only concerned with business logic” -> “the core domain model is concerned only with business logic” (misplaced ‘only’)

2018-01-01
60TYPO

“A Data Transfer Object or DTO, an object” -> “A Data Transfer Object, or DTO, is an object” (missing comma and missing word)

2018-01-01
64SUGGEST

“but they can get very complicated sometimes” -> “but they can get very complicated” (unnecessary and distracting word)

2018-01-01
64SUGGEST

Is there a way to force a page break before the definition of “squarePlusOne”? It’s hard to see the indent with it split across two pages.

2018-01-24
65TYPO

“x and y could by any type” -> “x and y could be any type”

2018-01-01
73TYPO

“to show that is a way to use” -> “to show there is a way to use”

2018-01-01
89TYPO

“type PlaceOrder = UnvalidatedOrder -> PlaceOrderEvents” - shouldn’t that be “ValidatedOrder”?

101TYPO

“Just be clear, an aggregate is not” -> “Just to be clear, an aggregate is not” (or at least I think this is what you meant)

2018-01-24
147TYPO

To be had -> to be held

103SUGGEST

“Other entities should only reference the Aggregate by its identifier” -> “Other entities should reference the Aggregate only by its identifier” (misplaced ‘only’)

2018-03-27
210TYPO

When using bind with validateOrderAdapted and priceOrderAdapted you have the resulting pipeline function of:

let placeOrder unvalidatedOrder =
unvalidatedOrder
|> validateOrderAdapted // adapted version
|> Result.bind validateOrderAdapted // adapted version

but the second function on the ‘bind’ line should be priceOrderAdapted, i.e. you’ve used validateOrderAdapted twice.

114SUGGEST

‘the important design guideline: “make illegal states unrepresentable.”’ -> ’an important design guideline: “make illegal states unrepresentable.’ or ‘the important design guideline, “make illegal states unrepresentable.”’ (hard to articulate why, but using a colon after ”the …" just doesn’t feel right)

2018-01-24
120SUGGEST

“only update one aggregate per transaction” -> “update only one aggregate per transaction” (misplaced ‘only’)

119TYPO

“That might be perfectly adequate solution” -> “That might be a perfectly adequate solution” (missing ‘a’)

2018-01-24
235ERROR

2nd paragraph in “Serializing Records and Choice Types Using Maps” section has dashes not rendered properly:

DTO structure&emdash;a key-value map can contain anything&emdash;so

178TYPO

in the second picture (Validate Order Validated Order -> X GetProduct Price, etc.) there is typo GetProduct Proce instead of Price, inside the picture itself

18ERROR

The figure on page 18 should be different to the one on page 17.

21TYPO

this language should used everywhere -> this language should be used everywhere

23SUGGEST

“A Command is … or another event. If the process succeeds, the state of the system changes and one or more Domain Events are recorded.”
Is it really always the case that the process have to result in a state change to be considered successful?
What about idempotent processes, do you consider the process as unsuccessful if it doesn’t need to change the state of the system? Later on page 133 the CreateEvents type is defined as PricedOrder -> PlaceOrderEvent list, the output type indicates that it’s possible to have no events generated.

Therefore I would suggest to accommodate this fact in the summary.

204ERROR

“Next, acknowledgeOrder and createEvents have no errors - they are ”one-track" functions …" but unfortunately they can’t be composed like shown in the example below. The functions doesn’t fit together, as you already state at page 180. The pricedOrder parameter would need to be carried over to the createEvents function, it means an adapted version of acknowledgeOrder is needed here.

235ERROR

Following text contains “&emdash;”. This seems like an improper formatting.
“The advantage of this approach is that there’s no “contract” implicit in the
DTO structure&emdash;a key-value map can contain anything&emdash;so
it promotes highly decoupled interactions."

267SUGGEST

In the “Using Active Patterns to Simplify Business Logic” section you showed a way to separate the code for categorization and business logic into different functions, however the code is still coupled. When you write a test for it, you would still need to know how the categorization is done.
You can achieve a true separation by passing the categorization into the business logic as parameter.

let calculateShippingCost (|UsLocalState|UsRemoteState|International|) validatedOrder =
// same code as the latest version of the function in the book.

61ERROR

Top of page has the following function:

let squarePlusOne x =
let square = x * x
square + 1

The description following the code describes the “let square =…” as a subfunction; however, as coded, it’s an int value. Perhaps the code should be as follows:

let squarePlusOne x =
let square () = x * x
square () + 1

18ERROR

The picture on page 18 is the same as on page 17 (two of the bounded contexts should be combined, and they are not).

67ERROR

Given…

type​ OrderQuantity =
​ \t | UnitQuantity ​of​ ​int​
​ \t | KilogramQuantity ​of​ decimal

let​ anOrderQtyInKg = KilogramQuantity 2.5 // doesn’t type check

needs to be…

let anOrderQtyInKg = KilogramQuantity (decimal 2.5)

18ERROR

The chart on page 18 is just the same as it is on page 17 and it doesn’t include the legacy system presented

157TYPO

“that parameter is fed into the first function (add) to start the data flow”

Should read

“that parameter is fed into the first function (add1) to start the data flow”

106TYPO

Page 106 refers to the file “Domain.SimpleTypes.fs”.
This file does not exist, I assume it should instead be “Common.SimpleTypes.fs”.

32TYPO

Written:

“The big question is whether can we make our code look as simple as this, too.”

Should be:

“The big question is whether we can make our code look as simple as this, too.”

227TYPO

Sentence reads as: “…but composing the deserialization pipeline is trickier because both the json.deserialize and the PersonDto.fromDomain can return Results.”

It should be “Dto.Person.toDomain” instead of “PersonDto.fromDomain” as Dto.Person.toDomain was defined with a return type of “Result<Domain.Person, string>” on page 225 and Dto.Person.fromDomain just has a return type of “Dto.Person” on page 224.

235TYPO

“&emdash;”s rather than actual emdashes:

The advantage of this approach is that there’s no “contract” implicit in the DTO structure&emdash;a key-value map can contain anything&emdash;so it promotes highly decoupled interactions

243235ERROR

The advantage of this approach is that there’s no “contract” implicit in the DTO structure&emdash;a key-value map can contain anything&emdash;so it promotes highly decoupled interactions.

61TYPO

The comment for the message alias near the bottom of the page reads “// an alias for to make the PaymentError type …”, I guess this should be “an alias for string to make the PaymentError type…”

16TYPO

if you want be effective
-> if you want to be effective

40TYPO

a “Order placed” event
-> an “Order placed” event

267TYPO

I believe ‘PricedOrderWithShippingMethod’ is being referred to as ‘PricedOrderWithShippingInfo’ four times on pages 267-269 in the PDF. ‘PricedOrderWithShippingInfo’ is not defined in the reference code repo (per commit acf8d697e2).

283TYPO

“… both the JsonDeserializer and PersonDto.toDomain” instead of fromDomain

epub book page 283-284

Categories: