Question 5 Which pattern would you use in the following situation: you have a Product class which knows its own inventory.  It should behave differently when it has inventory vs when it doesn't (e.g. a getPrice method returns "$5.99" or "Out of Stock"). Think about which class should be responsible for choosing the behavior in this case. 1) Strategy 2) Observer 3) State

Practical Management Science
6th Edition
ISBN:9781337406659
Author:WINSTON, Wayne L.
Publisher:WINSTON, Wayne L.
Chapter2: Introduction To Spreadsheet Modeling
Section: Chapter Questions
Problem 20P: Julie James is opening a lemonade stand. She believes the fixed cost per week of running the stand...
icon
Related questions
Question

Question 5

Which pattern would you use in the following situation: you have a Product class which knows its own inventory.  It should behave differently when it has inventory vs when it doesn't (e.g. a getPrice method returns "$5.99" or "Out of Stock"). Think about which class should be responsible for choosing the behavior in this case.

1) Strategy
2) Observer
3) State
 

Question 8

MVC's big advantage is that you don't need to tie communications between a UI and a data model to a specific implementation. True / False?

 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Practical Management Science
Practical Management Science
Operations Management
ISBN:
9781337406659
Author:
WINSTON, Wayne L.
Publisher:
Cengage,
Operations Management
Operations Management
Operations Management
ISBN:
9781259667473
Author:
William J Stevenson
Publisher:
McGraw-Hill Education
Operations and Supply Chain Management (Mcgraw-hi…
Operations and Supply Chain Management (Mcgraw-hi…
Operations Management
ISBN:
9781259666100
Author:
F. Robert Jacobs, Richard B Chase
Publisher:
McGraw-Hill Education
Business in Action
Business in Action
Operations Management
ISBN:
9780135198100
Author:
BOVEE
Publisher:
PEARSON CO
Purchasing and Supply Chain Management
Purchasing and Supply Chain Management
Operations Management
ISBN:
9781285869681
Author:
Robert M. Monczka, Robert B. Handfield, Larry C. Giunipero, James L. Patterson
Publisher:
Cengage Learning
Production and Operations Analysis, Seventh Editi…
Production and Operations Analysis, Seventh Editi…
Operations Management
ISBN:
9781478623069
Author:
Steven Nahmias, Tava Lennon Olsen
Publisher:
Waveland Press, Inc.