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

[CS2113T-T12-1] mTracker #32

Open
wants to merge 1,075 commits into
base: master
Choose a base branch
from

Conversation

theodorekwok
Copy link

mTracker is a command-line based trading journal interface that allows investors and traders to store and view important trading related information on their shortlisted financial instruments for reference and decision-making. It summarises key details into an easy-to-read format and helps to track profits/losses, thus providing convenient lookups for busy individuals.

Copy link

@Kair0s3 Kair0s3 left a comment

Choose a reason for hiding this comment

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

Overall, the developer guide provides a wide overview as well as some of the implementation/design rationales behind the components in the application. There was a good use of colours as well to "isolate" the different components for reader to follow.

However, some of the things that I felt could be improved in my opinion would be consistency and maybe reducing/decomposing some of the complex diagrams (which may help in readability).

But again, overall, good job and have a nice day!

## Design

> Tip: The diagrams in this guide were designed using PlantUML.
> Their original .puml files can be found in the diagrams folder here.
Copy link

Choose a reason for hiding this comment

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

I think that this might be due to time constraints but, maybe the "here" could be hyperlinked?


Major components of the app:
* `MTracker` contains the `main` method responsible for launching and
running the app. It first initializes the other components in the correct sequence
Copy link

Choose a reason for hiding this comment

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

The use of "correct sequence" seems to be confusing since there isn't any part telling the read the "correct sequence" to initialize, maybe a general idea of initialization would be sufficient?

instructions for user input, and other display texts. The class contains both
strings of commonly used display texts like the console input prompter, and
methods that print these strings out, thus ensuring satisfactory user interface and
communication with user.
Copy link

Choose a reason for hiding this comment

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

Maybe instead show the user communicating with the UI on the architecture diagram instead? (However I do understand that there might have been some rationale being doing the explanation in terms of word.)

eg.
image

Sorry for the bad drawing

Copy link

Choose a reason for hiding this comment

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

This is diagram has its good points as it has colours to signify the different components which the system and the colours matches those in the other diagrams.

Copy link

Choose a reason for hiding this comment

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

The only exception of the mismatch of colours would more likely be the ones in the sequence diagrams, though I understand that this could be due to readability reason of the sequence diagram. Perhaps, a different colour scheme could be used for Ui. Or have a note on the sequence diagram - similar to like a legend and explain why the use of another shade colour for the component.

* `filemanager` is responsible for saving the session's instruments data to local file, updating
them during runtime, and restoring data from previous session when the program is relaunched.

The subsequent sections will elaborate on the more technical design and implementation details of
Copy link

Choose a reason for hiding this comment

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

Really good to have this here, especially to "guide" the reader on what the subsequent parts will be focusing on, in relation to this architecture.

The figure below represents the class diagram of how all the parser classes interact with classes outside the `console`
package:

<img src="images/ConsoleDiagram.png" width="550"/>
Copy link

Choose a reason for hiding this comment

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

Maybe an additional note or a line of clarification after the digram would be nice to explain why the class diagrams themselves do not contain any methods/variables.

Choose a reason for hiding this comment

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

Should the lines between AddXYZParser and AddInstrumentParser, and AddInstrumentParser and InputParser be solid instead of dashed as it is an inheritance association and not an interface implementation association?

image


### Parser component

The main parent class in `console` package is the `InputParser` class which is defined in `InputParser.java`.
Copy link

Choose a reason for hiding this comment

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

Great to have this here to tell reader what this class/component does and what the following diagram is for.

Two alternatives to get the instrument information from the user were considered. The first alternative was to
get the user to add in all the information in a single line with separators
(for example: `stock TSLA; 909.68; negative; To buy`). This was not implemented as it is likely
for the user to enter the parameters in the wrong order. This becomes especially problematic if there are multiple
Copy link

Choose a reason for hiding this comment

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

This is good since it tells the reader the rationale being why this previous complex example was not taken into implementation.

* The command classes are dependent on the `TextUi` class. This allows the command class to display its execution results to the user.


The figure below represents the sequence diagram when the user executes a done command:
Copy link

Choose a reason for hiding this comment

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

Maybe could give a more specific use case description, in terms of what this test case does using index? From a reader's point of view, the 1 seems be taken in as an index as of the diagram, but not much seems to be explained about it in terms of the use case, like does this 1 mean just in general any of the instruments that is first in this instrument list, maybe this could be specified here?

Copy link

Choose a reason for hiding this comment

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

Maybe this half of the Command component can be shifted to after the instrument feature? That way, readers would have a rough idea of the implementation behind the instruments which can flow well into the use case of this done Command (Don't mind me too much! Just a suggestion)


The figure below represents the sequence diagram when the user wants to add a stock:

<img src="images/AddStockSequenceDiagram.png" width="1040"/>
Copy link

Choose a reason for hiding this comment

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

This might be nit-picky, but maybe the the small "hole" between :AddStockParser and the activation bar can be removed? Similarly with the :AddStockCommand

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 notes to explain some of the "hidden" logic eg. the prompting of user for more input details.

@theodorekwok theodorekwok changed the title [CS2113-T12-1] mTracker [CS2113T-T12-1] mTracker Oct 28, 2021
The figure below represents the class diagram of how all the parser classes interact with classes outside the `console`
package:

<img src="images/ConsoleDiagram.png" width="550"/>

Choose a reason for hiding this comment

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

Should the lines between AddXYZParser and AddInstrumentParser, and AddInstrumentParser and InputParser be solid instead of dashed as it is an inheritance association and not an interface implementation association?

image


<img src="images/ConsoleDiagram.png" width="550"/>

How the `InputParser` class works:

Choose a reason for hiding this comment

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

Maybe it will be helpful to include a sequence diagram to show how the different classes interact with one another during the processing of a command.

in `InstrumentManager.java` and `Instrument.java` respectively. This figure below represents the class diagram of
how the different class work together:

<img src="images/ModelDiagram.png" width="550"/>

Choose a reason for hiding this comment

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

It may be clearer to include the main class in the diagram to show where the association arrow originates from.

Similar to the console class diagram, should the lines between Instrument and the subinstrument classes be solid instead of dashed.

image


The Command component contains all the commands classes, where its respective class is instantiated when a valid command is entered by the user.

Commands include:

Choose a reason for hiding this comment

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

Maybe it will be clearer to display the Commands in a table with a short description of what they do, either here or in an appendix.

Slight typo in AddCryptoCommand


The figure below represents the sequence diagram when the user executes a done command:

<img src="images/DoneCryptoSequenceDiagram.png" width="1040"/>

Choose a reason for hiding this comment

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

Maybe it will be clearer if the sequence diagram leaves out less important method calls. E.g., getIndex(), getTypeIcon(), getStatusIcon(). As per the instructions here

Copy link

Choose a reason for hiding this comment

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

Agreed! If you would like to go into more details on the parsing process, perhaps consider using a ref frame instead :)


<img src="images/DoneCryptoSequenceDiagram.png" width="1040"/>

### FileManager Component
Copy link

Choose a reason for hiding this comment

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

Maybe it will be better to leave out some of the notes as they seem quite redundant. The methods are already well named and seem descriptive enough so there is no need to have the notes. Also, I think can remove the "return" for the return arrow.
Screenshot 2021-10-28 at 4 42 48 PM

3) AddStockCommand
4) ExitCommand
5) InvalidCommand
6) ListCommand
Copy link

Choose a reason for hiding this comment

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

Is DoneCommand supposed to be listed here as well? It was mentioned in the sequence diagram below but not here, which was slightly confusing.


The figure below represents the sequence diagram when the user executes a done command:

<img src="images/DoneCryptoSequenceDiagram.png" width="1040"/>
Copy link

Choose a reason for hiding this comment

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

Agreed! If you would like to go into more details on the parsing process, perhaps consider using a ref frame instead :)

`AddInstrumentParser` support the parsing of different instruments and their parameters.
This implementation provides greater extensibility to the add functionality to support more instrument types.

Two alternatives to get the instrument information from the user were considered. The first alternative was to
Copy link

Choose a reason for hiding this comment

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

While I think it is great that you explained the rationale for your specific choice of implementation, I feel that this segment could have been moved to the "Add instrument feature" segment instead so that this segment is just for showing the overall architecture of the component :)

`AddInstrumentParser#filterByInstrumentType()` which will then guide the user through the process of adding a new
instrument.

The figure below represents the sequence diagram when the user wants to add a stock:
Copy link

Choose a reason for hiding this comment

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

image

Perhaps the lifeline for AddStockParser should end after it returns the parameters?

Copy link

@rafaelperes rafaelperes left a comment

Choose a reason for hiding this comment

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

Hi T12-1. I've left some comments about your TP code. Hope it helps.


import java.io.ByteArrayInputStream;
import java.time.LocalDate;

Choose a reason for hiding this comment

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

@kum-wh perhaps remove this extra space?

import java.util.HashSet;
import java.util.Locale;

public class EditInstrumentParser extends InputParser {

Choose a reason for hiding this comment

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

@kum-wh @KVignesh122 @KVignesh122 @williamlamjy Overall, your code is neat, congrats! But maybe you could add javadoc comments for more complicated methods that may require explanation... I saw some long chunks of code, but no comments..

wingho2 and others added 24 commits November 5, 2021 19:43
# Conflicts:
#	docs/DeveloperGuide.md
…into branch-DG-UserStories

* 'master' of https://github.com/AY2122S1-CS2113T-T12-1/tp: (164 commits)
  PPP
  Fix checkstyle errors
  Fix according to pr review
  edits
  edits
  edited to pr and resize
  Remove space
  fix i/o redirection test
  Fix abort in main issue
  Make instrument decoders attribute protected not public
  edited accroding to pr
  Improve code quality
  Make edit status error messages more specific and remove polling for edit past returns
  added ppp not finished
  Fix import errors and ide warnings
  sizing
  edits to diags
  Changes based on PR
  edited encoding diag
  Fix merge conflict
  ...
theodorekwok and others added 30 commits November 7, 2021 23:25
…into branch-DG-changes

* 'master' of https://github.com/AY2122S1-CS2113T-T12-1/tp:
  Fix according to PR
  Fix spacing message.
  Fix jar naming.
  Changes according to PR
  Some changes
  Fixing links
  Changes according to PR
  More of abort section
  Adding the abort section
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.

9 participants