Assignment II Part 1: Blog Template
Note: This blog is written in Markdown. Please familiarise yourself with the Markdown syntax to ensure your blog is readable for your marker.
Task 1) Code Analysis and Refactoring ⚙️
Section titled “Task 1) Code Analysis and Refactoring ⚙️”a) From DRY to Design Patterns (6 marks)
Section titled “a) From DRY to Design Patterns (6 marks)”i. Look inside src/main/java/dungeonmania/entities/enemies. Where can you notice an instance of repeated code? Note down the particular offending lines/methods/fields.
[Answer]
ii. What Design Pattern could be used to improve the quality of the code and avoid repetition? Justify your choice by relating the scenario to the key characteristics of your chosen Design Pattern.
[Answer]
iii. Using your chosen Design Pattern, refactor the code to remove the repetition.
[Briefly explain what design choices you made]
b) Inheritance Design (6 marks)
Section titled “b) Inheritance Design (6 marks)”i. Name the code smell present in the description above. Which design principle is being violated here? Briefly justify your answer.
[Answer]
ii. Identify the other methods and subclasses of Entity with the same issue.
[Answer]
iii. Refactor the inheritance structure of the code to remove the code smell and design principle you identified.
[Briefly explain what design choices you made]
c) Open-Closed Goals (6 marks)
Section titled “c) Open-Closed Goals (6 marks)”i. Do you think the design is of good quality here? Do you think it complies with the open-closed principle? Do you think the design should be changed?
[Answer]
ii. If you think the design is sufficient as it is, justify your decision. If you think the answer is no, pick a suitable Design Pattern that would improve the quality of the code and refactor the code accordingly.
[Briefly justify your decision OR explain your design choices]
d) Open Refactoring (12 marks)
Section titled “d) Open Refactoring (12 marks)”[Briefly explain what design choices you made]
[Briefly explain what design choices you made]
Add all other changes you made in the same format here:
Task 2) Evolution of Requirements 🔧
Section titled “Task 2) Evolution of Requirements 🔧”Similarly to your assignment-i blog, your blog entries for task 2 should be a succinct overview of your design decisions, and any choices you made. Try not to just recount what you did - instead, you should be telling us why you made those choices.
[DELETE ONE OF THESE!]
[Option A]: Logic Switches (20 marks)
Section titled “[Option A]: Logic Switches (20 marks)”Design Decisions
[Briefly explain what design choices you made]
Assumptions/Other Notes
[Any other assumptions or notes]
[Option B]: Powerups and Potions (30 marks)
Section titled “[Option B]: Powerups and Potions (30 marks)”Design Decisions
[Briefly explain what design choices you made]
Assumptions/Other Notes
[Any other assumptions or notes]