-
Notifications
You must be signed in to change notification settings - Fork 248
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-F13-3] NUSplanner #52
base: master
Are you sure you want to change the base?
Changes from 206 commits
b86f624
f2be2cd
4999005
f8a8bae
8054e60
9b2e804
fdedcb5
c6ed908
c4a1298
54bd7a2
c27df2a
a49f77d
360a8ac
1918260
6590b1b
d7fdab9
0aa3573
49d8aa5
eff9915
1b5cc38
76e48bf
a3885ca
247c815
a8367ec
d3bac33
e2bde0f
95886c7
1280905
3a5d99e
dc68025
f85cd73
ad74d1f
c903e00
a459e03
d189560
674f8d0
a1498f6
39a4a10
cf8ba7e
a82124b
61656b0
0b5b635
1c0dea0
87e92f2
c01453a
c343fc5
8884dff
19ec44b
7b0a477
a9b0282
e33e8bd
2f88ed4
7085812
b3e3811
7916aa0
6516760
0f7a5c4
7585b7a
836552d
68c0526
f97a851
7d0f4e4
639c2ad
88af201
3f142f1
77fa44f
0944323
cdb9452
f70d968
ff4f95c
61e1789
ab0ca15
9878743
06908d4
ba1dd89
f4eb847
69e60c7
4eee560
e9d07f0
3825840
0654f7f
0fc2e7d
a706f9d
a11071a
774f70e
77031cf
be5fdb6
43bfc87
9450295
1c87415
070ffd0
dd51c1f
dc00d86
5a1891a
fcecd7f
2311efe
82b1b65
5b661d4
7d98c42
3eabd47
f408da2
7e7911e
4701b7d
1961a15
e998df7
37b97bb
47053b3
7bf9fcd
7a09187
bb4236a
e19aaa1
36e73d5
b831b81
6663b8b
5a6507d
23ffc20
1b7df87
1ed978c
9637558
8dceec5
a6d6cf9
6969864
72024ac
d22554e
2c047cb
ee9e60f
59b38ea
b7260bc
bbb880c
2fd9521
d16b709
e59d7c9
d27050e
070a04d
4d19f01
0f5d9ec
8d4cad1
f5c0c59
27dd3cf
c648a13
b572e7d
4a05c38
b31483a
6c86cf6
e653aa2
b3956e0
a83d1e7
a3763b6
34d16cb
6d93d2c
e3fec20
c015f50
2c18266
273c8dd
97460a1
03b457b
8985172
3fac01f
7d6e336
ac48405
bb2d476
72a6d79
0e2e920
4b65bea
4df408d
e2be67e
cac7cee
735775a
88e26ca
be613e5
46ddbc0
5ce7838
196045e
36bff11
4b8b5d2
95c21f9
b90850d
b006743
e3c0251
b89df4e
0daa9b4
2fdd1a7
9b65b02
c03ae13
9d769c1
c21b129
3c3312c
ad7f280
c980031
0bbcd10
f11a5a8
40a892e
4a737e6
dbcaf83
3a01779
cf1f2f1
282e2f4
53b6954
8caa365
7b9ba20
c1b5a1e
c95b55a
950768d
2013391
388e016
ca1ae8e
1d5609d
7a48c5f
3f339a7
c78ad9b
0f75cc6
9cd4004
ae4c73a
91deaeb
f2d5a93
8153ab0
7269867
e5d55a2
21d3bb9
f6e41a0
53bf4cf
4f1ed59
1c82ebd
10a17cf
ae2dc6d
bc4ee1a
4cf784b
4c8b288
96b743e
c169467
5fdd245
7a2ca7d
1e713f1
168c4df
0f4389d
eb3260f
ae94fe0
ca9c97f
238e8bc
12d8089
9d88701
9908e0f
6ee537c
0715981
743edf3
d9ced7e
59df5b3
7e0e8c8
d1f8e0b
a77443f
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,9 +1,9 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:---------:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Sel Gomez | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,93 @@ | ||
# Developer Guide | ||
Welcome to the NUSPlanner Developer Guide! | ||
We hope this documents serves useful to understand the behind-the-scenes working of our product. | ||
|
||
## Table of Contents | ||
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}' | ||
|
||
## Getting started | ||
|
||
Refer to the user guide [here](https://github.com/AY2223S2-CS2113-F13-3/tp/blob/master/docs/UserGuide.md). | ||
|
||
|
||
## Design & implementation | ||
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 you could include more elaboration such has system architecture and dependencies as well as relevant diagrams for clarity! However, it is already very clear! 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 like how all the diagrams are in details and that's a whole lotta effort to do it! However it would be greater if you can have an overall architecture! |
||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
### Parser Component | ||
The component will return the correct command based on what the user inputs into the application. | ||
|
||
#### How is the feature implemented? | ||
|
||
The Parser component parses the command of the user input and breaks the user input into different parts based on the flags. | ||
This component also ensures to validate that user input is correct. | ||
|
||
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. |
||
#### Why is the feature implemented this way? | ||
|
||
This component should be able to guide the user to inputting the correct format of the command to do data validation. | ||
It should be able to perform basic data validation checks to ensure that the user does not enter any invalid commands. | ||
This makes life easier to developers in the future if they wish to add new features that requires users to use new commands. | ||
|
||
### Storage Component | ||
API: `Storage.java` | ||
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. Well formatted and easy to read! |
||
|
||
The storage component reads and writes user data from a local save in the form of a `.json` file. | ||
The Storage component: | ||
* Serializes and deserializes user data into a `.json` file format through the use of the Gson library | ||
* Saves and loads information from the local hard disk | ||
|
||
The class diagram below illustrates the structure of the storage package | ||
|
||
![Storage Class Diagram](UML/Images/StorageClass.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. Simple and easy to read ! |
||
|
||
#### How the feature is implemented: | ||
|
||
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. |
||
![Storage Class Diagram](UML/Images/StorageSequenceDiagram.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. The diagram is good but it looks quite hectic. Consider breaking it up using reference frames with proper annotation for easier comprehension |
||
|
||
When the application starts up, the storage loadEvents() function will be called to load contents in the save file. | ||
Similarly, the state of the user's event list is saved when the user exits the application by calling saveToFile(). | ||
|
||
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. |
||
#### Justification for using gson | ||
The Gson library was chosen as it allowed for flexible adaptation of its TypeAdapter class, allowing for custom | ||
serialization and deserialization of data to be saved. | ||
|
||
### EventList component | ||
|
||
API: `EventList.java` | ||
|
||
this component maintains a list of Schedule instance. It receives commands from Parser.java and adds/deletes/edits tasks and their information in the list according to the commands. | ||
|
||
#### How is the feature implemented: | ||
|
||
the main functions are | ||
|
||
> - add new task (accepts event without starting time/ending time/ending date). | ||
> - delete a single tasks / delete all tasks. | ||
> - edit the time information of task (starting time/ending time/ending date can be omitted). | ||
> - search for a event by index / description. | ||
> - get all the detail of a event in the list in String form. | ||
|
||
The class diagram below illustrates the structure of the EventList component. | ||
|
||
<img src="UML\Images\EventListUML.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 you should consider noting down the methods within the UI and Parser classes 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. |
||
|
||
And below is a sequential diagram showing a event being added, revised, checked for information and finally deleted. | ||
|
||
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. |
||
<img src="UML\Images\EventListSD.png" style="zoom:80%;" /> | ||
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. Good job nice and easy to read ! 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. |
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#### Why implemented in this way: | ||
|
||
It is necessary to have a list which contains all the current event/class so that we can show/ batch process events more efficiently. Moreover, this component serves intermediary functions and avoids other classes access deep into the functionality of classes (Event, Schedule e.t.c) inside the ArrayList, thus reduces the coupling of the code base. Additionally, this component also converted all the String parameters parsed by Parser into various Types that required by other classes that the EventList contains, further reducing the coupling. | ||
|
||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
|
@@ -36,3 +114,6 @@ | |
## 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} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@startuml | ||
!include Style.puml | ||
hide circle | ||
skinparam classAttributeIconSize 0 | ||
|
||
class Storage{ | ||
- saveLocation : String | ||
- builder : GsonBuilder | ||
- gson : Gson | ||
+ void saveToFile(eventList) | ||
+ ArrayList<Event> loadEvents() | ||
} | ||
|
||
class com.google.gson.TypeAdapter{ | ||
} | ||
|
||
class EventListAdapter{ | ||
- dfWithTime : DateTimeFormatter | ||
+ void write(JsonWriter, ArrayList<Event>) | ||
+ void writeEvent(JsonWriter, Event) | ||
+ ArrayList<Event> read(JsonReader) | ||
+ Event readEvent(JsonReader) | ||
+ String readDate(JsonReader) | ||
+ String readTime(Jsonreader) | ||
} | ||
|
||
|
||
class EventList{ | ||
# taskList : ArrayList<Event> | ||
} | ||
|
||
|
||
|
||
Storage --> "1" EventListAdapter | ||
|
||
|
||
EventListAdapter .l> com.google.gson.TypeAdapter | ||
Storage . EventList : writes to < | ||
Storage . EventList : > gets data from | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
@startuml | ||
hide footbox | ||
box Storage | ||
-> ":Storage" : Storage() | ||
create ":Storage" | ||
activate ":Storage" | ||
create ":GsonBuilder" | ||
":Storage" -> ":GsonBuilder" : <<create>> | ||
activate ":GsonBuilder" | ||
create ":EventListAdapter" | ||
":Storage" -> ":EventListAdapter" : <<create>> | ||
activate ":EventListAdapter" | ||
":EventListAdapter" --> ":GsonBuilder" | ||
deactivate ":EventListAdapter" | ||
":GsonBuilder" --> ":Storage" | ||
deactivate ":GsonBuilder" | ||
create ":Gson" | ||
":Storage" -> ":Gson" : <<create>> | ||
activate ":Gson" | ||
deactivate ":GsonBuilder" | ||
":Gson" --> ":Storage" : gson | ||
deactivate ":Gson" | ||
deactivate ":Storage" | ||
end box | ||
box java.io | ||
participant ":File" | ||
participant ":InputStreamReader" | ||
participant ":FileWriter" | ||
end box | ||
":Storage" -> ":Storage" :loadEvents() | ||
activate ":Storage" | ||
create ":File" | ||
":Storage" -> ":File" : load file from local save | ||
activate ":File" | ||
create ":ArrayList<Event>" | ||
":Storage" -> ":ArrayList<Event>" : <<create>> | ||
activate ":ArrayList<Event>" | ||
alt !File.exists() | ||
":ArrayList<Event>"--> ":Storage" : empty ArrayList<Event> | ||
else File exists | ||
create ":InputStreamReader" | ||
":File" -> ":InputStreamReader" : <<create>> | ||
activate ":InputStreamReader" | ||
":InputStreamReader" -> ":Gson" : fromJson() | ||
deactivate ":InputStreamReader" | ||
activate ":Gson" | ||
":Gson" --> ":ArrayList<Event>" | ||
deactivate ":Gson" | ||
":ArrayList<Event>" --> ":Storage" | ||
deactivate ":ArrayList<Event>" | ||
deactivate ":File" | ||
deactivate ":Storage" | ||
end | ||
|
||
":Storage"-> ":Storage" :saveToFile() | ||
|
||
activate ":Storage" | ||
":Storage" -> ":File" : <<create>> if file does not exist | ||
activate ":File" | ||
":Storage" -> ":ArrayList<Event>" | ||
activate ":ArrayList<Event>" | ||
":Storage" -> ":Gson" | ||
activate ":Gson" | ||
":ArrayList<Event>" --> ":Gson" | ||
deactivate ":ArrayList<Event>" | ||
|
||
create "gsonData : String" | ||
":Gson" -> "gsonData : String" : toJson() | ||
deactivate ":Gson" | ||
activate "gsonData : String" | ||
|
||
create ":FileWriter" | ||
":Storage" -> ":FileWriter" : <<create>> | ||
activate ":FileWriter" | ||
"gsonData : String" --> ":FileWriter" | ||
deactivate "gsonData : String" | ||
":FileWriter" --> ":File" | ||
deactivate ":FileWriter" | ||
":File" --> ":Storage" | ||
deactivate ":File" | ||
deactivate ":Storage" | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@startuml | ||
|
||
class User { | ||
-semester | ||
+getSemester() | ||
+setSemester() | ||
} | ||
|
||
class UserUtility { | ||
-user | ||
+getUser() | ||
} | ||
|
||
@enduml |
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.
Very clear explanation of the features! Would be helpful to have an explanation of why you implemented your feature logic this way so other developers can understand your considerations.