Book cover

Errata: October 6th, 2020

Thank you for purchasing Object Design Style Guide. Please post errata not listed below in this book's LiveBook Errata thread. We'll update this list as necessary. Thank you!


Chapter 3, Exercise 5 (page 83)

The suggested answer introduces the greaterThanOrEquals() assertion function that isn't mentioned in the question. So the exercises should start with:

You can use the following assertion functions:

Assertion.greaterThan(value, limit);
Assertion.greaterThanOrEqual(value, limit);

Chapter 8, Listing 8.8

The repository's getById() accepts an int so PurchaseOrderId.fromInt(purchaseOrderId) should be purchaseOrderId.

Typos and layout issues

Chapter 1, Section 1.1 (page 3)

Typo: "A regular method,like" should be "A regular method, like"

Chapter 1, Listing 1.30 (page 17)

// ... 1((CO25-1)) should be // ...

Chapter 1, Listing 1.34 (page 21)

interface Mailer 1((CO28-1)) should be interface Mailer

Chapter 1, Listing 1.7 (page 4)

Class Foo only has a regular constructor, so the last line of this listing should be: object1 = new Foo();

Chapter 2, Listing 2.1 (page 27)

The brace on the next line after public function __construct(Formatter formatter) is not aligned correctly.

Chapter 2, Listing 2.2 (page 27)

Formatter formatter is not aligned correctly.

Chapter 2, Section 2.12 (page 59)

"For instance, the web controller needs a repository to fetch some objects from," (this last comma should be a semi-colon).

Chapter 2, Section 2.7.3 (liveBook only)

"But we could also let the client of MeetupRepositor y provide the current time as a method argument of findUpcomingMeetups( ).". MeetupRepository and findUpcomingMeetups() go in and out of "code" mode.

Chapter 3, Section 3.3 (page 75)

"Usually this will be caused be a programming mistake." Should be "caused by a ...".

Chapter 3, Listing 3.23 (page 84)

this.currency and targetCurrency are not aligned.

Chapter 3, Listing 3.27 (page 88)

In function fromString, the variable DateTime should start with a lowercase letter.

Chapter 3, Section 3.4 (liveBook only)

Title: "... the ex- xception’s message ..." should be ".. the exception’s message ...".

Chapter 3, Section 3.5 (liveBook only)

Title: "... from being verif- fied ..." should be ".. from being verified ...".

Chapter 3, Section 3.11 (liveBook only)

"An example of such an event is the following ProductCreate d class." (text goes in and out of "code" mode).

Chapter 4, Exercise 2 (page 110) = false; should be this.isActive = false;.

Chapter 5, Section 5.2.1, bullet point 3 (page 142)

Typo: "If you want use named constructors" should be "If you want to use named constructors"

Chapter 7, Listing 7.6 (page 177)

* @return EmailAddress[] should be aligned in the same as a couple of lines above.

Chapter 9, Exercises 4 (page 225)

The listing uses a PHP-style property name: $id should be id.

Appendix (page 257)

In the listing below "Objects have a magic constant that represents the full class name of the object as a string:": foo is a class name so it should start with a capital C, i.e. Foo (in both the code and the comment).

Styling issue with listings (liveBook only)

In many places the liveBook shows listings that end with: !@%STYLE%@!{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":69},{\"line\":0,\"ch\":70}],[{\"line\":9,\"ch\":70},{\"line\":9,\"ch\":71}],[{\"line\":19,\"ch\":70},{\"line\":19,\"ch\":71}]]"}!@%STYLE%@!