Modify your inventory management program from Assignment #3, to implement a Faade design pattern, along with some new features.
You will need to implement the following features from previous assignments.
From Assignment #1:
For more details, see the Assignment #1 description.
From Assignment #2:
For more details, see the Assignment #2 description.
If you are starting from Assignment #3, you can continue using the linked list collection class.
Note: Insufficient or incorrect datafill means that your assignment cannot be adequately tested; this may incur deductions of up to 100% of the assignment
Every time that a user invokes the product purchase feature, he/she indicates a set of products that he/she is buying. This set of products makes up an order , which you will now be storing in your program.
You will create a new Order class, and a new OrderArray collection class to contain a collection of order objects:
Notes:
The Faade design pattern is used to hide away complex processing from the rest of the program. This is done by creating a new Faade class that performs actions for the other classes in the program and hides the details of how these actions are done.
In our inventory management program, we will implement this Faade class as an order server . The purpose of this object is to store a collection of orders, as described in instruction #2, in a way that is transparent (hidden) from the rest of the program. For now, the orders will be stored locally on the same computer, but we are implementing the design pattern so that the orders could one day be stored remotely on a network, and all the processing to access the orders on the network would be hidden inside the order server object.
For this assignment, you will create the OrderServer class, which will store the collection of all orders. There will be a single instance of the OrderServer class, and that object will be contained in our programs inventory control object. The order server object will be the only object in the program to store the orders.
You will implement two member functions in the OrderServer class: update and retrieve. They will use the following prototypes:
void update(Order* order)
void retrieve(OrderArray& arr)
The update function adds a new order to the order servers collection. The retrieve function allows the inventory control object to retrieve all the orders in order to have them printed to the screen.
You will modify the product purchase feature so that, every time this feature is invoked, a new order is created for the specified customer. Every product selected by the user will be added to that order. Once the order is complete (when the user enters 0 to indicate that he/she is done), the new order will be sent to the order server for storage.
You will implement the print orders feature, which is available from the admin menu and from the hidden option in the cashier menu. This feature retrieves all orders from the order server object, and it prints all the data to the screen. Note: You must reuse existing functions everywhere possible.