Question
Blm 2 / 2 - Design Answer the rest of the questions using the following scenario. You have a software product, in which there exists
Answer the rest of the questions using the following scenario. You have a software product, in which there exists a number of Customers objects that contain a collection of customers. Some examples of these collections can be YoungCustomers, MiddleAgedCustomers etc. that contain a collection of customers that belong to a certain group. Client code may need to sort these collection objects according to the last names of the customers. One specific requirement is any particular collection can be sorted using a specific sort algortim. Moreover, this sort algorithm can be changed later for any collection. As an example, assuming that in this system we have BubbleSort, QuickSort and MergeSort; if a particular collection such as YoungCustomers is initially designed to be sorted using BubbleSort, at a later time it should be possible for YoungCustomers to switch to QuickSort instead. Your task is to select a design pattern suitable for this scenario and implement a design. In this scenario, focus only on the software design instead of the function. Therefore, do not try to implement the actual sort algorithms. It is enough for your sort procedures to just display a message along the lines of "collection is sorted using xyz algorithm."
Implement a client to test drive your design. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started