-
Notifications
You must be signed in to change notification settings - Fork 282
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-T13-3] WhereGotTime #36
base: master
Are you sure you want to change the base?
Changes from all commits
1300749
9778bde
0969d04
7483ae0
8c493e6
fc45902
f738291
5cb3593
bc77070
03fcb0d
db0e688
28a31eb
cf2b387
ae2978f
7637598
283b162
5daa8b8
165b567
90fa15d
2f70377
b757361
52a91b4
c2c0b41
561e84e
98757b8
858ed67
ca19e43
ffbe5da
534232f
78a6530
40b5f42
4aa9207
1ee674a
296c4d6
c77dd24
803219d
4728705
4eaa3d0
1c54405
5826c8e
a1a6321
5c2419a
5f5d157
1ec2e12
01f8230
9196717
6680063
0a3b4d3
606a5e3
0a37ea4
2f79645
1335e69
9729156
2e9552d
c82367f
c32aa66
e824793
aee81ed
1291d7a
95f7498
a200327
2eec44c
5d9ab4b
3dd0f1b
42b7996
cd922ee
e3baad8
c241c76
bf3c239
dcddb47
06ca3cf
4a7332e
e143f04
c8825f3
fbdb1c6
f201471
5e4ae1b
7264e33
7a1139b
a3e9dda
08629fd
3ecef96
7f38589
ff43337
3be4e27
69e6e55
9534dcb
f44cea8
1a7df37
4ea94e9
168b3fb
d597d42
b706959
3739eea
52c09b0
4b8f344
eba5fc8
0b43bbf
bf09077
4e00b9a
8b1bac9
9135965
0b1af38
2b1ac78
c6d97cc
591e19e
98e2db6
695c91a
0066693
c6d5018
68e787d
becb5c3
610f132
47cb0c2
54ccd62
37ff559
85faea6
19d5c7e
324d8cc
4a59754
5b29597
b48ee64
5b735c7
3d83fd4
f6b86b7
fcb8b76
eecf9ec
3d0ae2f
090f55f
4cf4788
9cef4a2
c3d8e69
49400fb
98e702f
5f92acd
4d25f52
c7519e1
5b46506
c50136b
284287e
20e0415
3ba815b
5be1b7b
9dd99d3
4b560e8
5d4dcc2
6b39532
39a1de6
a519411
073ccf6
e33b28e
b62e122
510248f
15195ff
72e4a2b
5c31061
a0cb6e7
34f187b
b35e708
7ee8352
51f100c
b0202ce
42c2a1b
956d53b
e611798
1b77694
9c86357
4ceef92
ef33ae6
9958b16
210ca08
68f621c
506b0ca
6147894
b284b19
25b4217
224126b
b45d36e
2ced37e
3dda531
8075136
b6f9a11
1e55864
81e82f8
c7108dd
9aea675
d796ecd
d7b8510
b7ca1f8
c5e8f32
eefe435
79fb149
0279a5d
0b6350f
e737e6b
0a17c40
b9e5429
3167aee
68d52ab
1b05634
10a95ff
7e92388
b8664ad
a22cd6d
3441f95
420eb3a
38caab1
519318d
0b0c2e9
b617394
6ffcb4e
bd1a4ef
c3812c1
a07ee12
c782ced
1229ea0
1b3bb89
2df1048
65aca4b
609069f
e310362
23cd0d6
7dba860
444762d
d34c5c3
d3e5f7c
dd61a00
4986d4d
d13bbb2
809ec9c
59697ce
52718a0
bfc412c
36d2352
a233d54
4d74922
7ad5154
af6aec0
524d26c
16873ee
e8bfb1e
7c9c91e
36d4012
932bfde
c5c339c
d9f7cf3
4da7466
f21ab36
5bc0a07
d8497a5
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 |
---|---|---|
@@ -1,34 +1,324 @@ | ||
# Developer Guide | ||
|
||
## Design & implementation | ||
## Table of content | ||
**1. Setting Up**\ | ||
**2. Design**\ | ||
**3. Implementation** | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
## 1. Setting Up | ||
|
||
**Prerequisites:** | ||
* JDK 11 | ||
* IntelliJ IDE | ||
|
||
Refer to the guide [_Setting Up_](SettingUp.md). | ||
|
||
## 2. Design | ||
|
||
### 2.1 Architecture | ||
The **Architecture Diagram** below shows a high-level design of WhereGotTime. The design is based | ||
on multi-tier architecture where the processing, UI, logic and data management are separated. The upper | ||
tiers make use of services provided by lower tiers. | ||
|
||
![](images/Overall Architecture.png) | ||
|
||
<div markdown="span" class="alert alert-primary"> | ||
|
||
</div> | ||
|
||
Here is a quick overview of the main components of WhereGotTime: | ||
1. `WhereGotTime` - initializes the components in the app | ||
1. `UI` - the user interface of the app | ||
1. `Parser` - analyzes and interprets user input | ||
1. `Command` - executes the action required by user | ||
1. `Storage` - reads and writes data to file | ||
1. `Common` - collection of classes used by multiple components | ||
* `Users` - the users who have logged into WhereGotTime | ||
* `Timetable` - the timetable of each of the users | ||
* `Event` - an object representing a lesson in the timetable | ||
|
||
**How architecture components interact** | ||
|
||
The following Sequence Diagram displays how components interact when the user inputs `clear /fri` | ||
|
||
![Architecture Sequence Diagram](images/ArchitectureSequenceDiagram.PNG) | ||
|
||
## 3. Design & Implementation | ||
This section describes how features/functions are implemented. | ||
|
||
### Parser Component | ||
|
||
![](images/Parser.PNG) | ||
|
||
The Parser object uses its parse method to parse inputs passed to it from Ui. This method returns a Command object to be executed by | ||
WhereGotTime. | ||
|
||
### Add Function | ||
|
||
#### System Architecture of the Add Function<br/> | ||
|
||
![](images/Architect-digram.PNG) | ||
|
||
The Architecture Diagram given above explains the high-level design of the add command.<br/> | ||
|
||
Below we will discuss a quick overview of each component. | ||
|
||
* UI: The User Interface of the app<br/> | ||
* Add Command: The main logic command of the add function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
|
||
#### Design of the Add Function<br/> | ||
|
||
UML Class Diagram of the Add function: | ||
![](images/uml.PNG)<br/> | ||
|
||
1) The Add function gets the inputs from the User and places it to the event class so that | ||
it can parser to string.<br/> | ||
2) It will then pass the event data onto UI class to display and inform user of the event added | ||
to the timetable.<br/> | ||
3) Next,the add function will pass all the parameters (event name,day,time | ||
and location) to the timetable class into its arraylist divided by the day of the week<br/> | ||
|
||
#### Sequence Design of Add Function<br/> | ||
![](images/seqdiagram.jpg)<br/> | ||
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. Perhaps this sequence diagram should be done using an online application instead of hand drawn? 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. Would it be better to use a software to draw the sequence diagram instead of hand drawing 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. There should be a return arrow from the activation bar under the Timetable class to the activation bar of execute(). |
||
|
||
#### Improvements made to Version 2.0<br/> | ||
* To ensure that the users do not enter duplicate event that has the same timing or in between the time | ||
that is entered. | ||
* A verification check is added to the add command of the version 2.0 of WhereGotTime. | ||
|
||
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. You could perhaps add a segment to explain the above sequence diagram? |
||
E.g. | ||
* add /CS2113 Lec /Mon /1200-1400 /LT21<br/> | ||
* add /CS2113 Lec /Mon /1300-1400 /LT22<br/> | ||
* add /CS2040C Tut /Mon /1100-1300 /LT32<br/> | ||
|
||
The above would result in the first line being add, | ||
while the other two will result in the app giving an error message | ||
prompting the user to re-enter again.<br/> | ||
|
||
### Edit Function<br/> | ||
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. This segment seems incomplete? Minimally some description of what these functions are instead of simply listing would be helpful to the reader. |
||
|
||
#### Class Diagram <br/> | ||
|
||
![](images/ClassDiagram_EditCommand.png)<br/> | ||
|
||
### Delete Function | ||
|
||
#### System Architecture of the Delete Function<br/> | ||
|
||
![](images/DeleteCommand_ArchitectureDiagram.png) | ||
|
||
The Architecture Diagram given above explains the high-level design of the delete command.<br/> | ||
* UI: The User Interface of the app<br/> | ||
* DeleteCommand: The main logic command of the delete function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
* WhereGotTime: The main logic component of the app<br/> | ||
|
||
#### Design of the Delete Function<br/> | ||
|
||
![](images/DeleteCommand_umlDiagram.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. Is there a better way to show 3 arrows pointing to Ui? Perhaps a slightly larger diagram would help? |
||
|
||
1. `DeleteCommand` gets the input from the User and gets the relevant timetable from `Timetable` | ||
1. `DeleteCommand` then proceeds to delete the event in the timetable based on the index in the user input | ||
1. `DeleteCommand` passes the day, deleted event and size of timetable to the `UI` | ||
1. `UI` updates the user of the successful deletion of the event | ||
|
||
#### Sequence Design of Delete Function<br/> | ||
![](images/DeleteCommand_SequenceDiagram.png)<br/> | ||
|
||
### Clear Function | ||
|
||
#### System Architecture of the Clear Function<br/> | ||
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. Perhaps the system architecture of the delete and clear functions could be consolidated, since they are similar in nature? |
||
|
||
![](images/ClearCommand_ArchitectureDiagram.png) | ||
|
||
The Architecture Diagram given above explains the high-level design of the clear command.<br/> | ||
* UI: The User Interface of the app<br/> | ||
* ClearCommand: The main logic command of the clear function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
* WhereGotTime: The main logic component of the app<br/> | ||
|
||
#### Design of the Clear Function<br/> | ||
|
||
![](images/ClearCommand_umlDiagram.png) | ||
|
||
1. `ClearCommand` gets the input from the User and gets the relevant timetable from `Timetable` | ||
1. `ClearCommand` then proceeds to clear all events from the timetable | ||
1. `ClearCommand` passes the day and cleared lesson to the `UI` | ||
1. `UI` updates the user of the successful clearing of events | ||
|
||
#### Sequence Design of Clear Function<br/> | ||
![](images/ClearCommand_SequenceDiagram.png)<br/> | ||
|
||
### List Function | ||
|
||
#### System Architecture of the List Function<br/> | ||
|
||
![](images/ListCommand_ArchitectureDiagram.png) | ||
|
||
The Architecture Diagram given above explains the high-level design of the list command.<br/> | ||
* UI: The User Interface of the app<br/> | ||
* ListCommand: The main logic command of the list function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
* WhereGotTime: The main logic component of the app<br/> | ||
|
||
#### Design of the List Function<br/> | ||
|
||
![](images/ListCommand_umlDiagram.png) | ||
Comment on lines
+157
to
+167
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.
Comment on lines
+166
to
+167
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. |
||
|
||
1. `ListCommand` gets the input from the User and gets the relevant user's timetable(s) from `Timetable` | ||
1. `ListCommand` then passes the user's timetable(s) to the `UI` | ||
1. `UI` prints all the classes in the timetable | ||
|
||
#### Sequence Design of List Function<br/> | ||
![](images/ListCommand_SequenceDiagram.png)<br/> | ||
Comment on lines
+173
to
+174
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.
Comment on lines
+173
to
+174
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. Might be better to add an activation bar under the Ui class when printList is called. After calling the printList method, arrows can then be used to indicate returning from Ui to ListCommand and also from execute() to the ListCommand class itself |
||
|
||
### Find Function | ||
|
||
#### System Architecture of the Find Function<br/> | ||
|
||
![](images/FindCommand_ArchitectureDiagram.png) | ||
|
||
The Architecture Diagram given above explains the high-level design of the find command.<br/> | ||
* UI: The User Interface of the app<br/> | ||
* FindCommand: The main logic command of the find function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
* WhereGotTime: The main logic component of the app<br/> | ||
|
||
#### Design of the Find Function<br/> | ||
|
||
![](images/FindCommand_umlDiagram.png) | ||
|
||
1. `FindCommand` gets the input from the User and gets the timetable from `Timetable` | ||
1. `FindCommand` then searches through the timetable to find event that match the keyword entered by User | ||
1. `FindCommand` passes the matching events to `UI` | ||
1. `UI` prints the matching events | ||
|
||
#### Sequence Design of Find Function<br/> | ||
![](images/FindCommand_SequenceDiagram.png)<br/> | ||
Comment on lines
+197
to
+198
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. |
||
|
||
### Compare Function<br/> | ||
#### System Architecture of the Compare Function<br/> | ||
![](images/CompareCommand_ClassDiagram.jpg) <br/> | ||
The System Architecture given above explains the high-level design of the <b>COMPARE</b> command.<br/> | ||
|
||
Listed below are some features we will be highlighting:<br/> | ||
|
||
* Ui: The User Interface of the app<br/> | ||
* CompareCommand: The main logic command of the <b>COMPARE</b> function<br/> | ||
* Timetable: The arraylist where events that are added are stored accordingly<br/> | ||
* User: User(s) of the program<br/> | ||
* UserList: An arraylist of User<br/> | ||
|
||
#### Design of the Compare Function<br/> | ||
![](images/CompareCommand_UML_Diagram.jpg)<br/> | ||
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. Is there a missing bracket in the getTimetable function? |
||
|
||
1) The <b>COMPARE</b> function gets the inputs from the User and retrieves the User's / Target User's<br/> | ||
timetables based on a specific day. It will then compare the timetables and return an arraylist | ||
of common timeslots.<br/> | ||
2) It will then pass the arraylist onto Ui class to display the range of common <br/> | ||
timeslots the User and Target User have on a specific day of the week.<br/> | ||
|
||
|
||
#### Sequence Design of Compare Function<br/> | ||
![](images/CompareCommand_SequenceDesign.jpg) <br/> | ||
Comment on lines
+223
to
+224
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. You can improve this by maybe making the arrow that indicate returning from the Ui class from the end of the activation bar, it should reach the activation bar of the execute() in CompareCommand class. Also, try to use puml for diagrams as it would be neater compared to drawing it by hand. |
||
|
||
#### Improvements made to Version 2.0<br/> | ||
* Display a range of timings instead of individual hours<br/> | ||
* Remove edge cases<br/> | ||
|
||
E.g.<br/> | ||
* compare /Alex /Mon<br/> | ||
* compare /Tammy /Mon<br/> | ||
|
||
These cases above would no longer output "0000HR, 0100HR" etc but | ||
instead "0000HR - 1000HR" | ||
|
||
### Login Function | ||
#### System Architecture of the Login Function<br/> | ||
![](images/LogInCommand_Architecture_Diagram_v001.png) | ||
* UI: The User Interface of the app<br/> | ||
* LogInCommand: The main logic command of the Login function<br/> | ||
* Parser: The main logic that takes input data and builds the command. | ||
* User: The Class where username, password, etc are stored | ||
* UserList: The Class that creates an ArrayList where the User objects will be stored | ||
|
||
#### Class Diagram | ||
![](images/LogInCommand_Class_Diagram_v002.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. Perhaps some methods like getters should be omitted from the class diagram to simplify and increase readability of the class diagram? 😄 |
||
1.) The LogInCommand checks the UserList to check if the inputted user already exists. | ||
<br/> | ||
2.) In the case that the User is a first time user, the LogInCommand will create a new User object then add it into | ||
the UserList. | ||
|
||
#### Sequence Diagram | ||
![](images/LogInCommand_Sequence_v002.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. Opt should be used instead of alt here as there are no alternatives provided. |
||
1.) When the user inputs a Login Command, a LogInCommand Object is created with the input member Username and Password. | ||
<br/> | ||
2.) The Login Command is then executed by sending the users UserList, ui Ui and the User nowUser to the method where | ||
it search the users to check if the input Username already exists with the correct password. | ||
<br/> | ||
3.) If the User already exists, it will return the User back to the method as currentUser. Otherwise, it will create a | ||
User with the input Username and Password. | ||
<br/> | ||
|
||
#### Improvements made to Version 2.0<br/> | ||
* In order to protect the User's privacy, the User's Passwords have been encrypted on the save file. | ||
* A Cryptography Class with encipherPassword and decipherPassword has been implemented as part of the version 2.0 of | ||
WhereGotTime. | ||
* Added Storage capability to allow saving and loading of user's timetable | ||
* revamped edit command so that it's more intuitive and user-friendly | ||
|
||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
Our Application, WhereGotTime is developed for University students. | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
It was developed to solve the inconvenience students face when accessing timetables and lecture venues and | ||
to keep track of their timetable. | ||
It is also developed to assist in finding common available time slots for students to study with their peers. | ||
|
||
## User Stories | ||
|
||
|Version| 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| | ||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
|v1.0|new user|login to my own timetable|be sure that it is my own timetable that is shown there| | ||
|v1.0|new user|add events into my timetable for the day|refer to the timetable to remind me of the event| | ||
|v1.0|new user|edit events that I have entered into my timetable for the day|easily change the details as I need it| | ||
|v1.0|new user|delete events in my timetable for the day|remove an event in the timetable that I do not wish to keep| | ||
|v1.0|new user|clear my timetable for the day|so that I can remove all the entries I have entered wrongly| | ||
|v1.0|new user|compare my timetable with my friends|schedule a common time for revision together| | ||
|v2.0|user|have my password encrypted|only I can access my own timetables| | ||
|v2.0|user|be assured that my inputs are correctly added|my input are correctly convey into the timetable| | ||
|v2.0|user|access my saved timetables|I do not have to manually enter the timetables again| | ||
|
||
## Instructions for manual testing | ||
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. Is it better to follow the format given in here? |
||
|
||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} | ||
login /Alex /123123<br/> | ||
add /CS2113 Lec /mon /1200-1300 /LT21<br/> | ||
add /CS3243 Lec /mon /1400-1500 /LT22<br/> | ||
add /CS2040C Tut /mon /0800-1000 /COM1-2<br/> | ||
add /CG2028 Tut /Thu /0900-1100 /E4-4-1<br/> | ||
add /CG2023 Lec /Fri /1700-1800 /E7-3-10<br/> | ||
list /all<br/> | ||
list /mon<br/> | ||
edit /mon<br/> | ||
/3 /1300-1400<br/> | ||
edit /fri<br/> | ||
/1 /0900-1100<br/> | ||
list /all<br/> | ||
list /mon<br/> | ||
login /Tammy /321321<br/> | ||
add /CS2113 Lec /mon /1200-1300 /LT21<br/> | ||
add /CS2040C Tut /mon /0800-1000 /COM1-2<br/> | ||
add /CG2028 Tut /Thu /0900-1100 /E4-4-1<br/> | ||
compare /Alex /mon<br/> | ||
list /mon<br/> | ||
edit /mon<br/> | ||
/2 /1000-1200<br/> | ||
compare /Alex /mon<br/> | ||
login /Alex /123123<br/> | ||
delete /mon /2<br/> | ||
clear /fri<br/> | ||
bye<br/> |
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.
Is the bracket of the execute function supposed to be beside "execute" instead of "void"?