Before you start to do your weekly exercise, please make sure that you already go through this week’s lecture slides (can be found in Modules).
What are the exercises?
Assume you are a senior software engineer, who is going to add ONE of the following features into a ball application. You can use the provided codebaseDownload codebase for this exercise which is the same one given to you in exercise 6 and exercise 7, but it would be better if you had your own working implementation with both Strategy and Observer patterns implemented in what you are building on – the added complexity will help you to see what the patterns are actually doing for you in code.
· A BallSpawner that allows new Balls to be added to the BallPit based on set parameters (colour, or colour and strategy) with random direction and speed (use the Prototype pattern)
Copyright By PowCoder代写 加微信 powcoder
· A Save and Restore state function that allows a list of saved states of the BallPit to be recorded and restored at will (use the Memento pattern)
Attention Please: 1) each of these features must be controlled using buttons you add to the BallPit UI; 2) you can choose any one of the above features to implement but you are also allowed to do both if you want.
What are you expected to do?
Task1: Refactor this codebase by using your selected design pattern (i.e., Prototype or Memento)
Task2: Model the codebase after refactoring in a UML class diagram
What are you expected to submit?
You need to submit two files, including a zip file of your refactoring codebase (i.e., src folder and build.gradle), and a pdf file of UML class diagram with a brief description identifying the corresponding participants of the selected design pattern on your code.
Attention Please: Write down the name of the design pattern(s) you have used in your submission at the top of your PDF file.
You can submit your solution any time before the due. Please note that, late submission will not be acceptable. 1 mark is awarded to you only if
· You submitted all required files, and your zip file only contains your src folder and build.gradle AND
· You apply the selected design pattern correctly in both UML diagram and codebase AND
· Your code compiles and runs successfully via gradle run AND
· You identify the corresponding participants correctly
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com