Description
Objectives
-
Practice procedural refactoring.
-
Practice implementing good/quality code.
-
Practice SOLID principles.
Preparation:
Clone the code on the repository https://git.cs.dal.ca/courses/2021-summer/csci-5308/assignment2/ronnie
Problem Statement
You have three main tasks in this assignment:
-
Refactor the code using what you learnt from lectures 6 and 7.
-
Increase code quality using the Java guidelines provided.
-
Refactor the code by applying SOLID principles.
-
Use exceptions wherever is necessary.
Task
-
[30 marks] Identify three (3) procedural refactoring opportunities that can be done in the code using the guidelines. Provide:
-
-
-
A brief description of each issue that require refactoring
-
-
-
-
-
Fix the issue.
-
-
-
-
-
Test your fix (when applied).
-
-
-
[60 marks] Identify three (3) refactoring that can be done in the code by applying SOLID Principles. Give:
-
-
-
a brief description of each issue.
-
-
-
-
-
where the issue is.
-
-
-
-
-
what SOLID principle is violated.
-
-
-
-
-
how to fix the issue.
-
-
-
-
-
Apply your fix.
-
-
-
-
-
Test your fix.
-
-
-
-
[10 marks] Identify three (3) methods requiring exceptions. Give:
-
-
-
-
method where exception should be used.
-
-
-
-
-
what the exception should be used.
-
-
-
-
-
Add the exception to the code.
-
-
-
Push back your work to YOUR remote repository, not to the one that you cloned. Everyone has their own repository to deliver this assignment, e.g., https://git.cs.dal.ca/courses/2021-summer/csci-5308/assignment2/yourscid.
-
Remember to check that all your files have been submitted using the web interface to git.
Submission
-
Edit this document with your written answers
-
All the code (fixed) should be committed and pushed back to your remote Git repository.
Important! Use individual commits to each answer.
Answers
Add your written answers here.