Abstract Pizza Factory Solution

profileTopsolutions
 (Not rated)
 (Not rated)
Chat

create the pizza factories from last homework, and then make singleton classes for the topping and crust factories

 

he reason that those factories should be singletons is because if i had all three pizza factories instantiated, i would have 3 different ToppingFactories and 3 different CrustFactories instantiated, and that is wasteful since those factories do the same thing. Instead, if those factories were all singletons, then i would only have one of each (topping and crust) instantiated and not waste memory duplicating functionality. Each individual topping (onion, tears, etc) must still be its own instance, but not the factories that choose them.

 

    • 11 years ago
    Complete A++ Solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      abstractpizzafactory_answer.zip
    • attachment
      abstractpizzafactory_answer.cpp