Hello fellow bloggers,
I was wondering if someone would clarify a section of the textbook I have referred to in the subject line.
Head First Design
Patterns refers to the following block of code, and makes some confusing statements about the nature of this code block. The code block is actually an example of poor object oriented design. The following comments were made in the textbook concerning this code block:
(1) This version of DependentPizzaStore depends on all those pizza objects, because it's creating them directly.
(2) If the implementations of these classes change, then we may have to modify DependentPizzaStore.
(3) Because
any changes to the concrete implementations of pizzas affects the DependentPizzaStore, we say that the DependentPizzaStore "depends on" the pizza implementations.
(4) Every kind of pizza we add creates another dependency for DependentPizzaStore.
Do you agree with the following statement?
With the exception of changes to the Pizza subclass constructors, the implementations of the Pizza subclasses can be changed at will without having any effect on the DependentPizzaStore. The DependentPizzaStore doesn't depend upon the pizza implementations(?)