-
Notifications
You must be signed in to change notification settings - Fork 101
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-T10-4] MindMyMoney #10
base: master
Are you sure you want to change the base?
Changes from 250 commits
fdac841
3ff0fcf
e38f14a
f77529c
72d17df
611e752
7eed2d4
c3c2e6a
6644c47
88cfcbe
22c5876
77ac1e0
0790f9a
7246438
d2f8a44
62f1f78
f25c6a9
5d4960a
a6dfe65
ed9afd3
0182680
ebe295b
9d2c1df
e481b5b
326cac7
7021769
3aefe4f
40ad536
95e6e28
d8233ee
dfc8c2e
4df94fa
54cb78e
fb85704
d3a28fe
7ec915b
694096a
7365659
604988e
12e998f
3a1c79c
4d3b1f6
e451658
ed29c2a
1bdae3a
ebb541e
769f927
6642868
0fc39c3
9af67a2
45e7924
9eba7d4
ed747cf
e91d3fe
3263f11
92f3849
7eecd33
ed5fe98
fbee545
c4cc185
560325e
1c60d4a
47f19a5
23288f3
7d60ce6
301bd26
d412c68
a960d1c
97ec792
b3d5a08
2c731f1
11a29cb
59a8de7
4251c41
4349b0c
6c5c760
01a0850
8416e09
d34c966
45d5625
e2f27d9
9e912b1
4df80a8
d93ff00
78db59f
baf0506
1aaeb5c
a79e747
f3b6e7a
32c3e18
aeae6ec
3819725
0ad988c
82e837e
b8e66ac
5cb6f80
cfbe10b
1fc68ea
96ab55d
6be11d7
c4ae21d
46228f1
da102a3
af7c72a
ef7d0bf
c9b19d3
4a914df
81dfa8c
0e65a0a
8f5be3e
2500d5b
f712f77
c50ce63
2646631
eff592d
f7455d0
6049a1f
6a87524
1288368
d0c7319
9c66d12
29e3db5
5ef1c1d
a6135a7
48528fa
3617390
cf6845b
85f218e
7cb5404
90a09a6
1c2aae1
3d091cb
02f541b
5e66c05
aee29d0
0ce3726
a2b874c
306dd65
b7f2a84
f80b1f6
c3f2d94
652d92a
2a6d866
8368030
eabe212
77bdb76
eb401c8
42b663d
2804e67
56f9d2a
6ca48c9
3464788
e353f71
d5cb5fe
e95f52d
17b23b9
44fa2f4
63ddbfa
dd08b2d
fa448e6
bcf7e6f
058e900
76a7461
5b2131e
3d04734
2c0d1cf
11e7948
ab37db7
57a0486
423fc0d
de12501
2f28022
da046af
6e8b2ac
05e83a2
78eae54
c0022ff
0c2b230
177d733
e13ffca
e8bf23e
d381bb2
8e5b49d
0348da5
f3a095a
72f35e2
fb0f99c
d8586ec
abf9b3b
f088be1
a5a9c63
7e6d54e
aa783eb
4e887e2
6b7035a
ada588e
0ea88c3
d3eec6f
02525c3
dab804f
b38f8c1
d723b5e
e918aac
3768b35
360de3f
ab5c33e
8fe9bb3
2443d60
0235f7a
f94a174
cdc7bce
d042663
2fff919
ee7d597
0d56941
0a2c989
4b4da22
fd20e16
4a7d058
c4db4d3
3902b93
e0af824
07e3175
6970464
0635adf
b120b8b
4e6ac67
4e1d5ab
97148f1
1547db2
9682b77
7f9cfe9
7434f2f
ce44a7d
98424f7
9b38e82
65efa25
06f73e4
f107049
fd2615f
7e08a0d
f873874
bc323ea
1b7eaa6
ab65695
fb96c07
02c51ee
79b63c0
796c151
2de331c
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 |
---|---|---|
|
@@ -15,3 +15,5 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.txt | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
list.txt | ||
/src/main/java/META-INF |
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) | Dan Baterisna | [Github](https://github.com/danbaterisna) | [Portfolio](docs/team/johndoe.md) | | ||
| [](https://via.placeholder.com/100.png?text=Photo) | Glendon Ng | [Github](https://github.com/GlendonNotGlen) | [Portfolio](docs/team/johndoe.md) | | ||
| [](https://via.placeholder.com/100.png?text=Photo) | Lim Jie Rui | [Github](https://github.com/limjierui) | [Portfolio](docs/team/johndoe.md) | | ||
| [](https://via.placeholder.com/100.png?text=Photo) | Seah Kit Han | [Github](https://github.com/khseah) | [Portfolio](docs/team/johndoe.md) | | ||
| [](https://via.placeholder.com/100.png?text=Photo) | Sean Ho Wen Bin | [Github](https://github.com/SeanHoWB) | [Portfolio](docs/team/johndoe.md) | |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,150 @@ | |
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
|
||
## Design & implementation | ||
## Design | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
### Architecture | ||
![architecture diagram](images/architecture_diagram.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. |
||
<br/> Fig 1 - Architecture Diagram | ||
|
||
The Architecture Diagram above shows the high-level design of the application. The **main components** | ||
consist of: | ||
- `MMM`: Initialises the components in the correct sequence and connects them with each other. Also holds the user's | ||
expenditures in memory. | ||
- `Ui`: The User Interface of the application and deals with interaction with the user. | ||
- `Parser`: Deals with making sense of user commands. | ||
- `Commands`: The collection of all executable commands. | ||
- `Storage`: Reads data from, and writes data to the hard disk. | ||
|
||
By abstracting out closely related code into classes, it allows`MMM`to deal at a higher level, without worrying | ||
about the lower level details. Higher cohesion is also achieved and coupling is minimized as each component is | ||
only coupled to the main class,`MMM`. | ||
|
||
The Sequence Diagram below shows an example of how the components interact with each other for the scenario | ||
where the user issues the command`add shoes 100`. | ||
|
||
![sequence_diagram](images/sequence_diagram.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. Excellent diagram that shows a high-level overview of how the application works. Colouring to differentiate the different components are also good! 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. For the sequence diagram, shouldn't the user go to :MMM with thecommand add shoes before the :Ui? 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 think they are trying to illustrate that the user enters the command through :UI, which is then sent to :MMM to handle, which will then parse and do the rest of the sequence. 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 use of color schemes to make the sequence and architecture diagrams more visually appealing and easy to follow through! 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. No critique here, just a really nice diagram sequence that details the architecture of your program! |
||
<br/> Fig 2 - Sequence Diagram | ||
|
||
The sections below give more details for each component. | ||
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. |
||
|
||
<br/> | ||
|
||
### UI component | ||
The source code can be found in [Ui.java](https://github.com/AY2122S2-CS2113T-T10-4/tp/blob/master/src/main/java/seedu/mindmymoney/Ui.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. I like how you guys include the link for source code in the DG 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. It's good that there's a source code hyperlink to the Github website |
||
|
||
![ui_diagram](images/ui_diagram.png) | ||
<br/> Fig 3 - Ui Diagram | ||
|
||
The UI component consists of a`Ui`and`PrintStrings`class. | ||
|
||
The UI component: | ||
- Prints the welcome banner and message on startup, as well as a financial tip from the`PrintStrings`class. | ||
- Prints`>`before the user's input, to help the user differentiate between their input and an output from the | ||
application. | ||
- Reads input from the user. | ||
|
||
<br/> | ||
|
||
### Parser component | ||
The source code can be found in [Parser.java](https://github.com/AY2122S2-CS2113T-T10-4/tp/blob/master/src/main/java/seedu/mindmymoney/Parser.java) | ||
|
||
![parser_diagram](images/parser_diagram.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. Would it be possible to clarify this diagram? It is a bit confusing because a package named Parser is used. But the code architecture does not have a package named parser. Would it be possible to rename it to a more suitable name like ExpenditureTracker? Because it houses not only parser, but also the other aspects like the ExpenditureList, Functions as well as Parser |
||
<br/> Fig 4 - Parser Diagram | ||
|
||
The Parser component consists of a`Parser`, `Functions`, `ExpenditureList` and `Expenditure`class | ||
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 labeling of figures may be better if placed above the diagram itself. |
||
|
||
The Parser component: | ||
- Receives user's input and splits it into the Command Type and Description using the`Functions`class. | ||
- Uses the`itemList`, which is an`ExpenditureList`object, to instantiate a`Command`object based on the Command Type. | ||
- Returns the`Command`object that can then be executed. | ||
|
||
We pass in the`itemList`to the`Command`object instead of using a global variable to ease testing. This way, we can | ||
add, delete and update`Expenditure`entries in a new`itemList`during testing without affecting the actual`itemList`. | ||
|
||
### Command component | ||
The source can be found in [command](https://github.com/AY2122S2-CS2113T-T10-4/tp/blob/master/src/main/java/seedu/mindmymoney/command) | ||
|
||
![command_diagram](images/command_diagram.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. This diagram is understandable as it shows the different commands available but perhaps an improvement that could be done is to add in the abstract method execute() also to show that all command types have this method in their own classes? |
||
<br/> Fig 5 - Command Diagram | ||
|
||
The Command component consists of `Command` abstract class, `AddCommand`, `ByeCommand`, `DeleteCommand`, `HelpCommand` | ||
, `ListCommand`and `UpdateCommand` that extends the `Command` class. | ||
|
||
The Command component: | ||
- Provides all the Command classes which can be instantiated by `Parser.parseCommand()`. The Command objects can then be | ||
executed. Only 1 Command object can be created. | ||
- Includes a `.executeCommand()` method in each Command classes which performs the relevant command and throws | ||
exceptions if an error is encountered. The error is then handled. | ||
|
||
### Storage component | ||
The source can be found in [Storage.java](https://github.com/AY2122S2-CS2113T-T10-4/tp/blob/master/src/main/java/seedu/mindmymoney/Storage.java) | ||
|
||
![storage_diagram](images/storage_diagram.png) | ||
<br/> Fig 6 - Storage Diagram | ||
|
||
The Storage component consists of `Storage` class. | ||
|
||
The Storage component: | ||
- `MMM` class initialises a `Storage` object upon start up. The `Storage` class consists of | ||
`load()` and `save()` methods. | ||
- Concurrently, `MMM` will call the `load()` method and load any data that is stored on the hard disk. | ||
- `MMM` calls the `save()` method and stores remaining data onto the hard disk when the program exits. | ||
|
||
|
||
## Implementation | ||
This section describes some noteworthy details on how certain features are implemented. | ||
|
||
### Add Command Feature | ||
#### Current Implementation | ||
The sequence diagram below shows the interactions of different subcomponents of the system when adding an expenditure | ||
to the list. | ||
![add_command_sequence_diagram](images/Add_Command_Sequence_Diagram.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. the return values should include the data type e.g. category: String 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 applies to all the return value 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 possible to enter the objectName:Datatype format for the return types? 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. |
||
A key functionality of MindMyMoney is the ability to add and track user expenditure. A user can add in a new expenditure | ||
by specifying the payment type, the category, the description of the item, the cost of the item and the date and the | ||
month purchased. | ||
|
||
1. The `Parser` component parses user input and returns the new `AddCommand` object to the | ||
`MindMyMoney`. | ||
2. `AddCommand` instantiates `addInput`, `expenditureList` and `creditCardList`. | ||
3. The application invokes `Addcommand.execute` to execute user instruction. | ||
4. During the execution, `Addcommand.execute` will parse through user input to obtain the `EXPENDITURE`, `CATEGORY`, | ||
`DESCRIPTION`, `AMOUNT` and `TIME` fields. | ||
5. The `Addcommand` object instantiates a new `Expenditure` object with the aforementioned 5 fields and adds them | ||
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 there should be another line to describe what the AddCommandInputTest#test(...) method does? |
||
into the `ExpenditureList`. | ||
6. The `Addcommand` object prints a list to show the user what it has saved. | ||
|
||
#### Design considerations | ||
Aspect: How to ask user for the 5 fields of input | ||
* Alternative 1 (current choice): User is asked to put in all 5 fields at once, separated using flags. | ||
* Pros: Faster input, user can enter an expenditure using a single input. | ||
* Cons: User must be able to remember all the flags and its sequence. | ||
|
||
* Alternative 2: User is asked iteratively to put in all 5 fields, prompted by a message after each input. | ||
* Pros: Beginner friendly, easily understandable, no need to remember flags. | ||
* Cons: Slower, implementation when user is familiar with the application. | ||
|
||
### Calculate Command feature | ||
|
||
To enable users to view their finances in a more meaningfully, MindMyMoney does calculations to present financial data | ||
that is actionable for the users. | ||
|
||
![calculate_command_sequence_diagram](images/gif_loading.gif) | ||
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. Unsure if the gif is supposed to be an indication of 'to be updated' as here it states that the picture is supposed to be a sequence diagram, but no sequence diagram is shown xD. 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. I thought it was intended but just curious why haha 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. Also curious about the loading gif! Is it a picture that was not rendered? 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. |
||
|
||
### List Command feature | ||
To enable users to view their current list of added expenditures. | ||
|
||
#### Design considerations | ||
Aspect: How to make the list command easily tested using JUnit testing | ||
* Alternative 1 (current choice): Abstract the conversion of Expenditure to String in a separate listToString() method | ||
* Pros: Easily tested using JUnit testing, by checking the String that the listToString() method returns | ||
* Cons: Added layer of abstraction that may be deemed redundant | ||
|
||
* Alternative 2: Print directly in the ListCommand.executeCommand() method | ||
* Pros: Easily implemented with lesser lines of code as the code is minimalist | ||
* Cons: JUnit testing would require I/O redirection prior to checking the output matches expectations | ||
|
||
![list_command_sequence_diagram](images/List_Command_Sequence_Diagram.png) | ||
|
||
## Product scope | ||
### Target user profile | ||
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. Target User is unknown so it is unclear who this software is for 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 comment
The reason will be displayed to describe this comment to others. Learn more.
There is no overview summary of what the software is all about