Comp 3700 Homework #5
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Comp 3700 Homework #5
Maximum points: 40
(Individual Assignment: OPTIONAL)
(Can be takenfor EXTRA CREDIT)
Assignment Goals: Apply the following concepts towards detailed class design:
1. GRASP design principles
2. Gang of Four Design Patterns
Instructions:
* Work on the homework on your own and don’t share your answers with any students.
* Submit a single pdf file (.pdf) to Canvas before the due date. This should be the only file you should submit to Canvas.
* No homework will be accepted after the due date, so make sure to start as early as you can.
Question #1 (10 Points): How can we ensure that Singleton class has only one instance? Briefly describe the class design.
Question #2 (5+5=10 Points): Consider an application that handles both general as well as private/personal information. Based on the type of data being handled, the system dynamically selects an appropriate data encryption approach to securely store the data. Identify the GoF pattern which can guide the system design for this requirement. Provide a brief reasoning for your selection.
Question #3 (5+5=10 Points): Consider an application which prints the given text in a specified format. Ifthe text is a single character, then the character is formatted as required and printed. Otherwise, if the text is multiple characters, then the first character is processed as earlier, and the prior procedure is called recursively on remaining text. Finally, the complete text is returned in required format. Identify the GoF pattern which can guide the system design for this requirement. Provide a brief reasoning for your selection.
Question #4 (5+5=10 Points): Consider an application which needs to keep track ofthe history ofrequests made and/or corresponding tasks performed, along with additional information regarding the tasks performed, to facilitate undo / redo oftasks. Which GoF design pattern is best applicable for this scenario? Provide a brief reasoning for your selection.
2021-12-01