Skip to content

Conversation

adnanvaldes
Copy link

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.

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant