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

[W6.2b][F09-4] Andrew Ong Ming En #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[W6.2b][F09-4] Andrew Ong Ming En #115

wants to merge 1 commit into from

Conversation

andrewome
Copy link

Added isMutating boolean to all command classes
storage.save only if command is mutated in logic.java

Copy link

@fanyiii fanyiii left a comment

Choose a reason for hiding this comment

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

Good job! As you add or modify methods, also remember to write comment to document it.

@@ -70,4 +70,8 @@ public int getTargetIndex() {
public void setTargetIndex(int targetIndex) {
this.targetIndex = targetIndex;
}

public boolean isMutating() {
Copy link

Choose a reason for hiding this comment

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

alternatively, this could also be specified as abstract, since all commands have their own implementation based on their behavior

@@ -85,7 +85,10 @@ public CommandResult execute(String userCommandText) throws Exception {
private CommandResult execute(Command command) throws Exception {
command.setData(addressBook, lastShownList);
CommandResult result = command.execute();
storage.save(addressBook);

Copy link

Choose a reason for hiding this comment

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

Since now the storage is only updated when a command is mutation, the header comment should be updated accordingly to reflect the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants