Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CS2113T-F12-1] PlanNUS #50

Open
wants to merge 786 commits into
base: master
Choose a base branch
from

Conversation

jerroldlam
Copy link

PlanNUS helps NUS undergraduates plan their academic journey in NUS. It is optimized for CLI users as commands can be typed in faster by undergraduates.

yeapcl added a commit to yeapcl/tp that referenced this pull request Oct 14, 2020
…l-Logging

Implemented Logging for LogInCommand.java
### Details

#### Global Component
Classes used by multiple components part of the global component of PlanNUS. This includes classes such as `App`,`Command` and `LoggingTool`. The main object classes `PartialModule`, `FullModule` and `Person` are also within the global component.
Copy link

@EdmundEXE EdmundEXE Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should global be global instead?

|`ModuleLoader`| Class representing all modules offered by NUS | `allModules` |
|`Person`| Class representing current user's information | `currentPerson`|
|`Ui`| Class representing java's default scanner class | `in`|
|`String` | Class representing the module code to be added | `moduleCode`|
Copy link

@EdmundEXE EdmundEXE Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should String be in the diagram?

The following diagram summarizes what happens when the user executes a `ModuleDetailsCommand`:

<div style="text-align:center">
<img src="./images/DeveloperGuide/moduleDetailsCommand_activity.png" alt="Activity diagram for View Module Details Command"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of this image seems to be different from the other similar diagrams?


#### Current implementation

`SetSuBySemesterCommand` is executed by `CapCalculatorApp`. It provides users with a suggestion on how they can S/U their modules added in `AcademicPlannerApp` by retrieving the `userMduleList` from the `Person` object and filter the list according to the semester provided to get a `suList`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be userModuleList?


`SetSuBySemesterCommand` is executed by `CapCalculatorApp`. It provides users with a suggestion on how they can S/U their modules added in `AcademicPlannerApp` by retrieving the `userMduleList` from the `Person` object and filter the list according to the semester provided to get a `suList`.

`suList` will then be analysed to provide user with a list of suggested S/U modules to achieve a best Cap.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be CAP? To follow as per what the title said.

The following sequence diagram shows how `ModuleDetailsCommand` works.

<div style="text-align:center">
<img src="./images/DeveloperGuide/moduleDetailsCommand_sequence.png"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the self-call validateModuleCode() have a return arrow, like in the other sequence diagrams?

Copy link

@EdmundEXE EdmundEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a few minor changes, I felt that the DG greatly utilises diagrams to make explanations easy to understand, great job!

/**
* Class representing main function of PlanNUS.
*/
public class PlanNus {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these lines be solid?
image
And I think apps should be connected to others?

try {
if (moduleValidator.isModTakenByUser(moduleCode)) {
removeUtils.removeModuleFromUserModuleList(moduleCode);
System.out.println(MODULE_REMOVED);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for printing something. According to your design, maybe can put it in the ui class?

private String moduleCode;

public RemoveModuleCommand(ModuleLoader allModules, Person currentPerson, Scanner in, String moduleCode) {
this.removeUtils = new RemoveUtils(currentPerson);
Copy link

@dmbclub dmbclub Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe can draw a diagram to show how these objects are created.

*/
@Override
public void execute() throws AcademicException {
try {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is alt instead of opt?
image

Copy link

@Aseanseen Aseanseen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments to take into consideration

Comment on lines +208 to +210
<div style="text-align:center">
<img src="./images/DeveloperGuide/editModuleCommand_initialState.png" alt="Initial state diagram for Edit Module Command"/>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change the boxes, as the rounded boxes are against standard uml notation
image

Comment on lines +242 to +244
<div style="text-align:center">
<img src="./images/DeveloperGuide/editModuleCommand_activity.png" alt="Activity diagram for Edit Module Command"/>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As not everyone will know how to read this diagram, perhaps add an elaborate explanation with the diagram. I think there are multiple occurences


* The `global` package contains classes, exceptions and objects that are required across the whole app.
* The `ui` package contains the class that is responsible for sharing one `scanner` class across the whole app to prevent multiple IO streams
* The `parser` package contains the class that handles user's app selection

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try to explain every part of the diagram, app parser was not explained here. Also, not sure if there is a specific meaning to the dotted line.

image

Comment on lines 31 to 41
### Architecture

{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing}
<div style="text-align:center">
<img src="./images/DeveloperGuide/Architecture.png" alt="Architecture diagram of PlanNUS"/>
</div>

The ***Architecture Diagram*** given above explains the high-level design of PlanNUS. Below is a quick overview of each component.



### Overview

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try to see if you can merge the 2 sections, as right now, based on the formatting it looks separate when you are actually explaining the architecture diagram


#### Global, Ui, Parser, Storage, Apps

* The `global` package contains classes, exceptions and objects that are required across the whole app.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is required across the whole app. But on the architecture diagram, we see that Global only has an arrow to PlanNUS which seemed to imply that it communicates only with PLanNUS and is independent of other packages.

Given below is an example usage scenario and how add module command behaves at each step.

<div style="text-align:center">
<img src="./images/DeveloperGuide/addModuleCommand_initialState.png" alt="Initial state diagram for AddModuleCommand"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is arrows going into the Ui person and ModuleLoader, unclear what they are doing. The AddModuleCommand recieves some information from these 3, the diagram doesn't show what the relationship is.

<img src="./images/DeveloperGuide/addModuleCommand_finalState.png" alt="Final state diagram for AddModuleCommand"/>
</div>

**Step 7** : `FileHandler`, `Logger`, `PartialModule`, `ModuleValidator`, `AddUtils` and `AddModuleCommand` are terminated.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find what ModuleValidator did in the whole process.


__Step 2:__ The `execute()` method is called from the instance of `EditModuleCommand` which only throws `AcademicException` if applicable.

__Step 3:__ Method `isModTakenByUser()` of the `ModuleValidator` is called to check if the `moduleCode` entered by the user exists within the `userModuleList` and `userModuleMap`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show this on the diagram. The diagram gives very little information on describing this sequence of steps. Maybe label the step numbers on the diagram for better clarity.

Copy link

@GuoAi GuoAi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DG is very nicely done! Perhaps you could also consider to add more explanations or diagrams at places which may cause confusion to new developers.


## Product scope
### Target user profile
* Table of contents
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table of contents is well done! I like how I can navigate to different sections by clicking on the title.


{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing}
<div style="text-align:center">
<img src="./images/DeveloperGuide/Architecture.png" alt="Architecture diagram of PlanNUS"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can consider explaining here why Apps is not interacting with other packages?
image

Comment on lines +89 to +91
<div style="text-align:center">
<img src="./images/DeveloperGuide/Project_structure.png" alt="Architecture diagram for ideal project structure in PlanNUS"/>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is App Entry Point also a package? I am a bit confused about App Entry Point in this diagram showing the interaction among packages.
image

Comment on lines +98 to +100
<div style="text-align:center">
<img src="./images/DeveloperGuide/Packages_Interaction.png" alt="Sequence diagram for lifecycle of PlanNUS"/>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sequence diagram is very clear and informative. Well done!

### Details

#### Global Component
Classes used by multiple components part of the global component of PlanNUS. This includes classes such as `App`,`Command` and `LoggingTool`. The main object classes `PartialModule`, `FullModule` and `Person` are also within the global component.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introduction of your global component sounds a bit abstract to me. It seems to contain several classes, but I cannot get information about how these classes interact with each other and what the function of each class is. Would it be better if you insert a class diagram here?

Comment on lines +164 to +166
<div style="text-align:center">
<img src="./images/DeveloperGuide/addModuleCommand_state6.png" alt="State diagram for AddModuleCommand Step 6"/>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The object diagrams you use to show the state after each step are very clear!

Comment on lines +179 to +181
<div style="text-align:center">
<img src="./images/DeveloperGuide/addModuleCommand_sequence.png" alt="Sequence diagram for AddModuleCommand"/>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this diagram showing the different branches given different cases of user inputs.

Comment on lines +242 to +244
<div style="text-align:center">
<img src="./images/DeveloperGuide/editModuleCommand_activity.png" alt="Activity diagram for Edit Module Command"/>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this diagram for EditModuleCommand, perhaps you could explain how a user chooses whether she wants to edit semester or grade? The conditions for these two branches are not very clear to me.
image

Copy link

@ZhongNingmou ZhongNingmou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall your job is good but may need to add more details.

Comment on lines +83 to +85
* `commands`: A package that handles all executable commands given by parser
* `commons`: A package with the utilities and shared classes across the parent package
* `exceptions`: A package to handle all exceptions thrown across the parent package

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can explain more about "App Entry Point" because it shows in your diagram but there is no explanation about this.

Comment on lines +103 to +105
<div style="text-align:center">
<img src="./images/DeveloperGuide/Details_architecture.png" alt="Details architecture diagram of PlanNUS"/>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit confused about the relation between Apps and PlanNUS because in the previous diagram "Architecture" there is no connection between Apps and other components and in this "Details" diagram there is no connection neither, maybe you can explain more about this?
dg1

Comment on lines +192 to +194
<div style="text-align:center">
<img src="./images/DeveloperGuide/addModuleCommand_sequence.png" alt="Sequence diagram for AddModuleCommand"/>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sequence diagram is very clear and the previous diagrams explained each step clearly! Well done.

Comment on lines 232 to 236
__Step 4:__ `in` reads the next line of input for user's choice of modifying either the semester or grade of the selected `moduleCode`.

__Step 5:__ `isValidSemester()` or `isValidGrade()` is called to validate the semester or grade entered by the user.

__Step 6:__ `updateModuleSemester()` or `updateModuleGrade()` is then called to conduct necessary changes to the information by accessing the module from `userModuleMap` and `userModuleList`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add diagrams of these steps.

Copy link

@mrwsy1 mrwsy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall well done, can consider adding more line breaks in between each section :)


## Table of contents
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better if u numbered the individual sections for the table of contents? And the sections themselves

<img src="./images/DeveloperGuide/Architecture.png" alt="Architecture diagram of PlanNUS"/>
</div>

The ***Architecture Diagram*** given above explains the high-level design of PlanNUS. Below is a quick overview of each component.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe can explain why Apps is not linked to anything else
image

Comment on lines +210 to +217
The following options were considered when implementing commands:

* Option 1 (Current Implementation): Implementing each command as a class by itself
* Pros: Increases modularity of code, higher overall code quality
* Cons: More complicated to implement
* Option 2: Implementing each command as a method in a class
* Pros: Easier to implement
* Cons: Class needs to be instantiated and increases coupling, reducing testability. This method also decreases SLAP.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe u can put this into table format so it's easier to read and do comparison between pros and cons

Given below is an example usage scenario and how add module command behaves at each step.

<div style="text-align:center">
<img src="./images/DeveloperGuide/editModuleCommand_initialState.png" alt="Initial state diagram for Edit Module Command"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can have a caption underneath the image to relate it to the steps, otherwise a little confusing

jerroldlam and others added 30 commits November 9, 2020 18:37
Fix bugs when shifting modules
Fix Bug in storage check
Fix handling of duplicated modules
Add further checks for adding modules
[PPP] fixed broken reposense link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.