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

Refactor classes #165

Merged
merged 3 commits into from
Oct 31, 2021
Merged

Refactor classes #165

merged 3 commits into from
Oct 31, 2021

Conversation

chunweii
Copy link
Collaborator

Closes #163

@chunweii chunweii added priority.High Should be resolved first, failing which, the project will not work type.Task Something that needs to be done, but not a story, bug, or an epic labels Oct 29, 2021
@chunweii chunweii added this to the v1.4 milestone Oct 29, 2021
@chunweii chunweii self-assigned this Oct 29, 2021
@chunweii chunweii added this to In progress in tP Project Dashboard via automation Oct 29, 2021
@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #165 (d4f2d17) into master (531ee91) will decrease coverage by 0.69%.
The diff coverage is 62.94%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #165      +/-   ##
============================================
- Coverage     65.59%   64.90%   -0.70%     
+ Complexity      942      927      -15     
============================================
  Files           124      126       +2     
  Lines          3305     3294      -11     
  Branches        422      428       +6     
============================================
- Hits           2168     2138      -30     
- Misses          964      965       +1     
- Partials        173      191      +18     
Impacted Files Coverage Δ
...rc/main/java/seedu/address/logic/LogicManager.java 51.61% <0.00%> (-3.56%) ⬇️
...u/address/logic/commands/contact/CViewCommand.java 0.00% <0.00%> (ø)
...edu/address/logic/commands/event/EViewCommand.java 0.00% <0.00%> (ø)
...dress/logic/parser/contact/CViewCommandParser.java 0.00% <ø> (ø)
...address/logic/parser/event/EViewCommandParser.java 0.00% <ø> (ø)
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø)
...main/java/seedu/address/model/contact/Contact.java 89.36% <ø> (-2.56%) ⬇️
src/main/java/seedu/address/ui/ContactCard.java 0.00% <0.00%> (ø)
...c/main/java/seedu/address/ui/ContactListPanel.java 0.00% <0.00%> (ø)
src/main/java/seedu/address/ui/EventCard.java 0.00% <0.00%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 531ee91...d4f2d17. Read the comment docs.

@chunweii chunweii marked this pull request as ready for review October 30, 2021 18:00
Copy link
Collaborator

@pcgiang pcgiang left a comment

Choose a reason for hiding this comment

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

Some minor suggestions, overall LGTM!

this.predicate = predicate;
}

@Override
public CommandResult execute(Model model) {
requireNonNull(model);
model.setContactDisplaySetting(ContactDisplaySetting.DEFAULT_SETTING);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this line necessary? if we call clist a/ then cfind, this would change the display to the default one? our current implementation is to keep the same display of clist i think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem with such an implementation is that if the user calls the view commands earlier, then if they call the find command, the full details would be shown.

this.willDisplayAddress = willDisplayAddress;
this.willDisplayZoomLink = willDisplayZoomLink;
this.willDisplayTags = willDisplayTags;
this.isViewingFull = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

would it be more logical to move this setting to be inside the individual contact instead of the whole contact list? but if this works for cview and eview, i guess its okay

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is very similar to the old implementation, whereby the settings are stored as static variables. It is possible to have the individual contacts and events store these settings. But since we are trying to make contacts and events immutable, I think there will be a major performance cost involved, as each time we call those commands which will change the display settings, all events and contacts will need to be replaced.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm if we only move the isViewing setting to be managed by individual contact/event, we would only need to re-create the specific contact/event for cview/eview right? but i also feel its a bit weird if only isViewing setting is separated from the rest of the setting. haha but yeah i think ur current implementation is fine too 👍

tP Project Dashboard automation moved this from In progress to Reviewer approved Oct 31, 2021
@pcgiang pcgiang merged commit d662c81 into master Oct 31, 2021
tP Project Dashboard automation moved this from Reviewer approved to Done Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Should be resolved first, failing which, the project will not work type.Task Something that needs to be done, but not a story, bug, or an epic
Development

Successfully merging this pull request may close these issues.

Refactoring
2 participants