Errata

Architecture Patterns with Python

Errata for Architecture Patterns with Python

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Introduction
Encapsulation and Abstractions

The code example with duckduckgo is not compatible with modern Python (3). The following is needed to reproduce the search result of the other examples

import duckduckpy
for r in duckduckpy.query('Sausages').related_topics:
print(r.first_url, ' - ', r.text)

Note from the Author or Editor:
confirmed. we will fix this

Olav Vahtras  Jun 12, 2020 
1. Domain Modeling
Section "Dataclasses Are Great for Value Objects"

I am reading Architecture Patterns with Python. In chapter 1, Domain Modeling, I am reading the section "Dataclasses Are Great for Value Objects." The examples of "Math with Value Objects" do not work. I have tried Python 3.6 and Python 3.8. Am I missing something here? I see this occur:

>>> tenner = Money('gbp', 10)
>>> fiver + fiver
('gbp', 5, 'gbp', 5)
>>> fiver + fiver == tenner
False

I would expect fiver + fiver to equal tenner based on what the book says, but the book appears to contradict my Python interpreter. What is the problem here?

Note from the Author or Editor:
The latest online version has a correction for this issue http://www.cosmicpython.com/book/chapter_01_domain_model.html#_dataclasses_are_great_for_value_objects

Tom Huibregtse  Mar 31, 2021 
9
Digital edition, Chapter 9, Figures 9.1 and 9.2

Chapter 9, Figures 9.1 and 9.2 are identical.

Note from the Author or Editor:
Confirmed. We will try and get the correct image added asap.

Jazeps Basko  Mar 08, 2020 
Printed
Page 85
class AbstractUnitOfWork

__enter__(self) is missing


A second error (typo) on page 86: (1) The UoW provides an attribute called .batches, ... =>. should be: „called batches, ...“

Note from the Author or Editor:
the first error is correct but minor. the second is just the reader being obtuse, imo.

Anonymous  Oct 27, 2020 
Page 116
Figure 6-2. With UoW: UoW now manages database state

I believe the arrow from "Services" to the "Domain" is missing. If I am wrong, I would appreciate a clarification why.

Thank you,
Chris

Note from the Author or Editor:
Hi there, no you're right there could or should be an arrow pointing from services to domain.

I think maybe we were trying to emphasize the fact that the service layer goes via the UoW and the repositories to get to the domain objects. but once it has them, it talks to them directly of course.

I think we can fix that in a future edition. thanks!

Do let us know how you're getting on with the book in general! You can email me (harry) via obeythetestinggoat@gmail.com, or find us both on twitter...

Christopher Graf  Jan 27, 2022