-
Notifications
You must be signed in to change notification settings - Fork 94
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
[CS2113-T15-3] Module Manager #27
base: master
Are you sure you want to change the base?
Changes from 208 commits
0170c29
81304ed
fa6ba33
6b1bce3
0bf12df
26fa797
718cad7
190ca37
0ef6b95
00609ad
125a609
908275f
8f50541
0e3657a
408ec27
deab1ff
93f5cb6
73e7d9d
bcb9569
caa1895
20515d9
fdd446d
c856e6f
4a618ad
ae4bcac
d398f57
400beb6
85ac194
04695c1
027a219
955d219
0e0d60b
3dad101
3af0ce0
bb9146f
b3d3a8d
db6a2bf
09ae766
a741379
dbdb4bd
7195564
92021ec
b524437
5694e89
96857ee
c550b68
721225b
d11c43b
7b2382c
bcd849f
2d2d8c2
aea7a3a
b824311
896ff6a
d182711
be584a4
2089eac
93b0c31
38ca6a9
85ba26d
cc888e0
daca90a
e7abace
2faf0d7
008e765
f032022
55aff35
5b07c38
c7c8e75
6a9e05a
e4c81f5
6655a44
7536b43
3dadbb3
49285c7
6542c3f
9da4ab8
ccc8e4e
2a6f3af
ff8aab7
b9e22ac
ab4f107
5071319
41d2244
5375c00
ddf9af7
fc95853
907ab8a
0b971c8
b1d78b2
5480f51
b7cd90e
29537de
0e1c0c8
9846425
867a18c
5cef69d
7bbbb5e
0f6ea1b
11fd28d
340c403
0666a48
7d604b8
493e20c
5ec9631
e581509
c9d45d7
f2a9ac0
503a20b
33a3f93
3d51e9a
9abf359
42cbf2e
9bde3f7
0a787f0
424a8d4
5afefe6
eb30299
c668cee
4b84b15
6bf25cc
1e35a83
d1f3733
f868eb3
18c99ce
72d9e4e
282c237
e18305b
8f6305f
c07194d
594ece5
7a3684a
de3cae4
1c4d4b6
35a0ba7
4297b70
8ef90e8
4829af4
6c8c1b0
08e4fb5
7d7cb81
cba7ed4
11a75cf
1980bd4
248dbe7
9b4b5a4
c26914d
bc5858f
54fa9d3
3b37591
b511ab3
63e66d4
f8f976a
3ce4092
bd7fe1e
97f54b6
b83fa0e
1b4781d
3fbaaf1
5694f77
e63e3f5
08c74ef
f8d7761
3c2faf4
c2f0d3e
cc76c74
fa3ad4f
ecb4f55
565e97c
a88fd52
1856821
372fe13
a5b3f6f
e9dc9ab
1db60bc
196b61f
f360fc8
87fb027
39e3af1
f2e7e5d
3e477ab
1cc9114
a9b7406
2221cde
756bd77
6cc7ebc
747c7ef
4e13fe7
5435f97
5cd8846
e75ce05
6694bf4
5b3f103
c03266a
83e1089
9842665
1ddd461
b6e2b9d
db833e5
9a4d560
a237fc8
039b46a
bd08610
5c20c39
c8eae23
be58310
f43aaa3
736bb36
f3c1a4f
0c9026b
bb57209
137a0d7
8e0d375
200a0d1
99f9c9d
1ababaa
f13a1c5
cac7a97
7ca372b
d6f5658
44d5ae5
1f66d9d
1cc7662
a096b7d
ee35a19
c91c694
173cc67
e0354ab
5a278a8
356b020
c999d0f
a301644
5b26b55
f44c54e
32a053c
ac20668
bb44b1d
35f7ebf
5b53a42
e3bc2a3
ddca98e
7275bd1
496b1bb
106868f
3a11a9d
c7d20f3
ce5211b
8ff3f7e
5519f9b
c750dc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ src/main/resources/docs/ | |
*.iml | ||
bin/ | ||
|
||
/text-ui-test/ACTUAL.txt | ||
/text-ui-test/ACTUAL.txt | ||
*.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,5 @@ checkstyle { | |
|
||
run{ | ||
standardInput = System.in | ||
enableAssertions = true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
id,name,mc,prerequisites | ||
CS1010,Programming Methodology,4, | ||
CS2030,Programming Methodology II,4,CS1010 | ||
CS2040,Data Structures and Algorithms,4,CS1010 | ||
CS2100,Computer Organisation,4,CS1010 | ||
CS2106,Introduction to Operating Systems,4,CS2100 | ||
CS2113,Software Engineering & Object-Oriented Programming,4,CS2040 | ||
CS2105,Introduction to Computer Networks,4,CS2040 | ||
ES1000,Foundation Academic English,4, | ||
ES1103,English for Academic Purposes,4,ES1000 | ||
CS2101,Effective Communication for Computing Professionals,4, | ||
CS2102,Database Systems,4,CS2030 CS1231 | ||
CS2101,Effective Communication for Computing Professionals,4, | ||
CS2102,Database Systems,4,CS2030 CS1231 | ||
GEH1001,Globalisation and New Media,4, | ||
GEH1002,Economic Issues in Dev World,4, | ||
GEH1004,Chinese Heritage: Hist & Lit,4, | ||
GEQ1000,Asking Questions,4, | ||
GER1000,Quantitative Reasoning,4, | ||
GET1001,Seeing the World Through Maps,4, | ||
GET1002,Bridging East and West: Exploring Chinese Communication,4, | ||
GET1003,Home,4, | ||
GES1000,Singapore Employment Law,4, | ||
GES1002,Global EC Dimensions of S'pore,4, | ||
GES1003,Changing Landscapes of Singapore,4, |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
User,Y1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
id,name,mc,semester,isDone,grade | ||
cS1010,/,4,3,false,/ | ||
cs0000,/,3,4,false,/ | ||
CS0001,/,4,4,false,/ | ||
CS2113,Software Engineering & Object-Oriented Programming,4,4,false,/ | ||
cS1010,/,4,4,false,/ | ||
cs2113,/,4,5,false,/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,172 @@ | ||
# Developer Guide | ||
|
||
## Design & Implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
### Architecture | ||
|
||
![Architecture Diagram](https://github.com/DeetoMok/tp/raw/master/docs/images/Architecture.png) | ||
|
||
The Architecture Diagram given above explains the high-level design of the Module Manager Application. | ||
|
||
Module Manager consists of a main class called Duke responsible for | ||
* At app launch: Initializes the components in the correct sequence, and connects them up with each other | ||
* At shut down: Shuts down the components and invokes cleanup method where necessary | ||
|
||
The other components involved are: | ||
|
||
`UI`: The user interface of the application | ||
|
||
`Storage`: Reads data from, and writes data to, the hard disk | ||
|
||
#### UI component | ||
The `UI` component consists of a `Ui` class that stores all user interaction output data. | ||
It displays all user interactions to the user based on the command line inputs received. | ||
|
||
The `UI` component, | ||
|
||
* Executes user commands using the `Logic` component | ||
|
||
#### Logic component | ||
The `Logic` component | ||
|
||
1. `Logic` uses the `Parser` class to parse the user command. | ||
2. The parsed command is passed to `Controller` which then returns a specific command class | ||
e.g. `AddCommand`, `FindCommand` etc. which is executed by the main class `Duke`. | ||
All these command classes inherits from the abstract `Command` class. | ||
3. The command execution can affect the Model (e.g. adding a module in ModuleList) | ||
4. The result of the command execution is passed back to the Ui. | ||
5. In addition, the command execution can also instruct the `Ui` to perform certain actions, | ||
such as displaying help to the user. | ||
|
||
#### Model component | ||
The `Model` component | ||
* Stores a `Person` object that represents the user's details. (e.g. `totalCap`, `totalModuleCreditCompleted`) | ||
* Stores the `ModuleList` and `SemesterList` Data | ||
* Does not depend on any of the other three components | ||
|
||
#### Storage component | ||
The `Storage` component, | ||
* can save `personInfo` objects in csv format and read it back | ||
* can save the available module list in csv format and read it back | ||
* can save the semester list in csv format and read it back | ||
|
||
|
||
### Implementation | ||
|
||
#### `Add to Semester` feature | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The diagram looks very neat and helps the developer understand the basic logic of add to semester future. So perhaps, is the explanation repetitive here? |
||
The `Add to Semester` mechanism is facilitated by `AddtoSemCommand` which extends from `Command`. | ||
It allows `ModuleManager` to assign a module to a semester by adding the module to a | ||
`SemModulesList`, it implements the following operations: | ||
|
||
Given below is an example how the `Add to Semester` behaves at each step. | ||
|
||
##### Step 1: | ||
The user launches the application for the first time. The `SemesterList` will be initialized with the none | ||
`SemModulesList` in it. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean to say "empty SemModulesList"? |
||
|
||
##### Step 2: | ||
When users enter a add to semester command, e.g `add id/CS2113 s/4 mc/4`, this command will be parsed in `Parser` | ||
and then `Parser` returns a `AddToSemCommand`. `AddToSemCommand` then calls `Command#execute(SemesterList semesterList, | ||
AvailableModulesList availableModulesList) ` | ||
`(AddToSemCommand#execute(SemesterList semesterList, AvailableModulesList availableModulesList))` | ||
|
||
##### Step 3: | ||
`AddToSemCommand#execute()` then calls self method `AddToSemCommand#addModule()`.`AddToSemCommand#addModule()` | ||
then calls `AddToSemCommand#checkModuleExist(semesterList)` to check whether the selected | ||
RenzoTsai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
module is already in the selected module list (i.e:`semesterList`, which is a `PriorityQueue<SemModulesList>`). | ||
If the module is not in the list, `AddToSemCommand#addModule()` will check whether there is a semester list | ||
(i.e:`semesterModulesList`, which is a `ArrayList<SelectedModule>`) whose name is the module's semester name. | ||
If the semester list exist, the module will be added to the list. | ||
If not, `AddToSemCommand#addModule()` will create a new semester list and then add this module to the new list. and the | ||
the new semester list will be added to `semesterList` as well. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found this section quite confusing to read as there are a few variables and classes with similar names (semesterList, SemModulesList, semesterModulesList, SemesterList), and the multiple 'if' condition checks. Perhaps it would help to briefly explain the connection between semesterList and semesterModulesList, at the very beginning, before delving into the logic? I.e. "semesterList represents XXX and stores instances of SemModuleList. semesterModulesList represents XXX and stores XXX" |
||
|
||
#### Step 4: | ||
`AddToSemCommand#execute()` calls `Ui.showAddedToSemMessage(selectedModule.announceAdded())` to show the result to the | ||
user | ||
|
||
The following sequence diagram shows how the `Add to Semester` operation works: | ||
![Sequence Diagram of Add to Semester](https://github.com/RenzoTsai/tp/blob/Update_DG/docs/UML%20img%20folder/Sequence%20Diagram%20of%20Add%20to%20Semester.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
|
||
#### Calculate CAP feature | ||
|
||
The Calculate CAP mechanism is executed by `CalculateCapCommand`. | ||
`CalculateCapCommand` is extended from `Command` and this implementation calculates the CAP using completed | ||
`SelectedModule` stored in `SemModulesList`. | ||
|
||
Given below is the behaviour of the Calculate CAP mechanism at each step: | ||
|
||
Step 1: | ||
User launches the application. `SelectedModules` are added to `SemModuleList` through either of the following methods: | ||
1) Imported from `semesterList.csv` using `StorageSemesterList.load()` | ||
2) Added using `add id/ID s/SEMESTER mc/MODULE_CREDIT` command | ||
|
||
Step 2: | ||
User executes `CAP` command to view his own CAP. The `CAP` commands is parsed through `Parser`, which would then return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
`CalculateCapCommand()`. `CalculateCapCommand.execute()` is then called. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am wondering if it is fully clear weather object representing CalculateCapCommand class or a Person Object Calculates the total cap. More specifically, the setTotalCap() method and getTotalCap() methods are pointed in the same direction, so I wasn't a 100% sure from the diagram where the CAP calculation was happening. |
||
|
||
Step 3: | ||
`CalculateCapCommand.execute()` will call `CalculateCapCommand.calculateCap(SemesterList semesterList)`, which will | ||
calculate CAP by looking for all the completed `SelectedModules` stored within `SemModuleList`, which are stored within | ||
`SemesterList`. It will then assign a `double` type ranging from 0.00 to 5.00 to `Person.totalCap`. | ||
|
||
Step 4: | ||
After the CAP is assigned to `Person.totalCap`, `Person.totalCap` is then called and formatted using `DecimalFormat` into a `String` | ||
with a pattern of `#.00`. `Ui.showcap(cap)` is called to display the user's cap using the formatted `String`. | ||
|
||
The following diagram shows how the Calculate CAP operation works: | ||
![Calculate CAP feature](https://github.com/bennychanya/tp/blob/master/CalculateCap.png?raw=true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with what Isabella said about the construction of CalculateCapCommand. Otherwise it looks good to me. Perhaps you may want to specify the return value (grade) of the getGrade() method to be consistent, as you did so for totalCap? |
||
|
||
|
||
##### | ||
|
||
|
||
|
||
## Product Scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
* A computer science undergraduate of NUS with a need to manage modules | ||
* Prefer desktop apps over other types | ||
* Able to type quickly | ||
* Prefers to control apps with typing rather than a mouse | ||
* Comfortable using Command Line Input apps | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
Manage and plan modules quickly with CLI, faster than a mouse or GUI driven app | ||
|
||
## User Stories | ||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|Priority| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||
|***|User|View my study plan|Keep track of what is my study plan when I forget about it| | ||
|***|User|Add and assign modules to different semesters|Update my study plan| | ||
|***|User|Add modules to available module list|Add the module to my study plan when I plan to in the future| | ||
|***|User|Delete study plans in specific semesters|Update my study plan according to my new plan in mind| | ||
|***|New user|see usage instructions|Refer to instructions when I forgot how to use the App| | ||
|***|User|Mark module as done|Update my study plan according to modules that I have completed| | ||
|**|User|Calculate cap|Check my current cap based on modules I have completed| | ||
|**|User|find a module by name or module code|Locate a module and its module code without having to go through all the modules| | ||
|
||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
1. Should work on any mainstream OS as long as it has Java `11` or above installed. | ||
2. Should be able to hold up to 1000 modules in the available module list without a noticeable sluggishness in | ||
performance for typical usage. | ||
3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) | ||
should be able to accomplish most of the tasks faster using commands than using the mouse. | ||
|
||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
**Mainstream OS** - Windows, Linux, Unix, OS-X | ||
|
||
|
||
|
||
## Instructions for Manual Testing | ||
|
||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if Model component is not related to other three components, then how would a Person object, which is stored in Model Component, have their CAP calculated? Maybe "does not depend" is not the correct phrase here?