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

[CS2113-W10-4] uNivUSaver #6

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

Conversation

DanLinhHuynh-Niwashi
Copy link

@DanLinhHuynh-Niwashi DanLinhHuynh-Niwashi commented Sep 18, 2024

uNivUSaver is a CLI-based software that helps students to develop a better habit of managing money.

Copy link

@joshuan98 joshuan98 left a comment

Choose a reason for hiding this comment

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

Overall it seems like there are multiple functions that are quite long. You should consider refactoring these into separate files or functions to handle them instead.

@@ -0,0 +1,76 @@
/*

Choose a reason for hiding this comment

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

I would recommend removing this file since it is entirely commented out.

@@ -0,0 +1,51 @@
/*

Choose a reason for hiding this comment

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

Similarly, this entire file has been commented out. You can consider removing this,

src/main/java/seedu/main/Main.java Outdated Show resolved Hide resolved
*/
public class Parser {
/** Map that associates command words with their corresponding {@code Command} objects */
private static Logger logger = Logger.getLogger("Parser");

Choose a reason for hiding this comment

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

Should logger be declared final?

src/main/java/seedu/main/Parser.java Outdated Show resolved Hide resolved
private Transaction item5;
private Transaction item6;
@BeforeEach
public void setUp() throws Exception {

Choose a reason for hiding this comment

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

Good use of BeforeEach for setup

1. **commands: LinkedHashMap<String, Command>**
- Description: Associates command words (as keys) with their corresponding Command objects (as values).
#### Class main methods
1. **registerCommands(Command command): void**

Choose a reason for hiding this comment

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

The arguments should follow the UML style notation, namely
command : Command in the parameters


![register_command](./diagrams/parser/register-command-sequence.png)

2. **parseCommand(String commandPart): Command**

Choose a reason for hiding this comment

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

Arguments here as well should follow the UML notation 😄

The `TransactionList` class is responsible for storing user transactions of different types. It also provides various
operations that enable user to add, delete, search by (date/ category/ keywords).

![TransactionList](./diagrams/TransactionList/transactionlist-class-diagram.png)

Choose a reason for hiding this comment

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

Great to see both Class diagrams and Sequence diagrams being used! 😸


2. **parseCommand(String commandPart): Command**
- **Parameters**:
- `commandPart`: A string representing the command word entered by the user.
Copy link

@isaacsaw25 isaacsaw25 Oct 30, 2024

Choose a reason for hiding this comment

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

The formatting is a bit strange on the deployed website, where I believe you expected to place Returns: on a new line, but it prints on the same line as the explanation for the previous part 😰 . Perhaps you could try using a double space, which is kind of the equivalent of an escape character in Markdown. 👍

![Category](./diagrams/category/category-class-diagram.png)

### TransactionList
The `TransactionList` class is responsible for storing user transactions of different types. It also provides various

Choose a reason for hiding this comment

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

In the class diagram, I feel that you could exclude the get functions, as their usage and implementation are quite trivial to the architecture of the class. 😅

- **Process**:
- Filters `transactions` to include only `Expense` objects with the specified `category`.
- Returns the filtered list of expenses.
![SearchByCategory](./diagrams/TransactionList/transactionlist-Sequence-SearchByCategoty-diagram.png)

Choose a reason for hiding this comment

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

In this diagram, the 3rd self-invocation has a chain of 3 methods. Perhaps consider splitting the functions up into multiple invocations? 🐱

Copy link

@isaacsaw25 isaacsaw25 left a comment

Choose a reason for hiding this comment

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

Great work overall, only minor flaws in the formatting to fix 😎

Copy link

@NigelYeoTW NigelYeoTW left a comment

Choose a reason for hiding this comment

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

Overall good progress, there seems to be some small issues with the diagrams but else lgtm, well done.

Comment on lines 16 to 23
#### Class main methods
1. **registerCommands(Command command): void**
- **Parameters**:
- `command`: The `Command` object to be registered.
- **Process**:
- Retrieves the `COMMAND_WORD` field from the `Command` object
- Adds the word and the command to the `commands` map.

Choose a reason for hiding this comment

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

Formatting error, also seen throughout the DG.

Choose a reason for hiding this comment

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

There should not be a class at the end of the lifeline

Choose a reason for hiding this comment

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

self invocation should have a activation bar, comments can be placed inside notes

Choose a reason for hiding this comment

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

inconsistency in parameters. some have class type, some do not

Choose a reason for hiding this comment

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

additional Category class not used in diagram, Catergory2 could be named better

Choose a reason for hiding this comment

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

sequence diagram class should have ':' regardless if there is a name for the class

Choose a reason for hiding this comment

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

TransactionList has a missing dependency to Transaction class

Choose a reason for hiding this comment

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

not sure if Income should have a composition to TransactionList

Choose a reason for hiding this comment

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

please follow UML notation for access modifier

Choose a reason for hiding this comment

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

inside the [] should be the terminating condition

Choose a reason for hiding this comment

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

not too sure why there were ' in the diagrams

- Aggregates and counts relevance for each match.
- Sorts the results by relevance and returns the list of matched transactions.
![SearchByKeywords](./diagrams/TransactionList/transactionlist-class-SearchKeyword-diagram.png)
5. **getExpensesByCategory(category : Category) : List<Transaction>**

Choose a reason for hiding this comment

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

There seems to be a formatting issue here seen throughout the DG as well

@@ -1,29 +1,240 @@
# Developer Guide
Copy link

Choose a reason for hiding this comment

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

Good use of class and sequence diagram, would it be possible to add the object diagram as well?


### Class Main Methods

1. **execute()**
Copy link

Choose a reason for hiding this comment

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

Should it be execute() : List<String> instead?


![extract_arguments](./diagrams/parser/extract-arguments-sequence.png)

4. **splitCommandRecursively(String argumentString, String[] keywords, Map<String, String> arguments, String prevKeyword): void**
Copy link

Choose a reason for hiding this comment

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

The arguments should follow the UML notation, would it possible to amend it?

@@ -1,29 +1,240 @@
# Developer Guide
Copy link

Choose a reason for hiding this comment

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

Overall, there is formatting issue especially the arguments for a few commands do not follow the UML notation

Oshen27 and others added 30 commits November 12, 2024 11:12
Update UserGuide.md add FAQ and notes
Update UserGuide.md change formatting
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.

8 participants