Skip to content

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 ⚙️”

Link to your merge request

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]

Link to your merge request

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]

Link to your merge request

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]

Merge Request 1

[Briefly explain what design choices you made]

Merge Request 2

[Briefly explain what design choices you made]

Add all other changes you made in the same format here:

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!]

Links to your merge requests

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)”

Links to your merge requests

Design Decisions

[Briefly explain what design choices you made]

Assumptions/Other Notes

[Any other assumptions or notes]