From 380c0d6d237d07713b6d873535c384dac0e4eee3 Mon Sep 17 00:00:00 2001 From: Adnan Valdes Date: Sat, 7 Jun 2025 14:01:01 +0200 Subject: [PATCH] Consistent usage in 4-application-development.md In the Epilogue of Part 10, Section 4, the dependency injection example uses `storage_service` to illustrate the ability to maintain a user interface even when storage locations change. However, in the example it shows: ``` class PhoneBookApplication: def __init__(self, filename): self.__phonebook = PhoneBook() self.__filename = filename # the rest of the user interface # use a different filename storage_service = FileHandler("new_phonebook.txt") ``` The `PhoneBookApplication` class constructor should continue to use `storage_service` with the filename change only being applied in the name passed to `FileHandler`. --- data/part-10/4-application-development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/part-10/4-application-development.md b/data/part-10/4-application-development.md index c5607e01..d5e669aa 100644 --- a/data/part-10/4-application-development.md +++ b/data/part-10/4-application-development.md @@ -807,9 +807,9 @@ This removes an _unnecessary dependency_ from the `PhoneBookApplication` class. ```python class PhoneBookApplication: - def __init__(self, filename): + def __init__(self, storage_service): self.__phonebook = PhoneBook() - self.__filename = filename + self.__storage_service = storage_service # the rest of the user interface