-
Notifications
You must be signed in to change notification settings - Fork 163
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
[T6A1][W10-B4]Li Chengcheng #527
Conversation
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.
Good attempt.
As we are now using StorageStub
in LogicTest
, we need not test the correctness of StorageFile
when we test the Logic
class. There is a line in the assertCommandBehavior
method that checks for the contents on the disk with the contents in memory; this should be removed.
@@ -17,7 +18,7 @@ | |||
public class Logic { | |||
|
|||
|
|||
private StorageFile storage; | |||
private Storage storage; |
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.
👍
private StorageFile initializeStorage() throws StorageFile.InvalidStorageFilePathException { | ||
return new StorageFile(); | ||
private Storage initializeStorage() throws StorageFile.InvalidStorageFilePathException { | ||
return new StorageFile();//I'm not sure how to get rid of this coupling |
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.
Yes, this part is unfortunate, but it's the best we can do right now. The original design already violates OCP. Fyi, an issue has been raised regarding this se-edu/addressbook-level3#75
public abstract AddressBook load() throws StorageOperationException; | ||
public abstract void save(AddressBook addressBook) throws StorageOperationException; | ||
public abstract String getPath(); | ||
} |
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.
👍 but careful with identation...
import seedu.addressbook.data.AddressBook; | ||
import seedu.addressbook.storage.StorageFile.StorageOperationException; | ||
|
||
public class StorageStub extends Storage { |
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.
Header comment will be useful...
return path; | ||
} | ||
|
||
} |
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.
👍 better to put StorageStub
in the test
directory though...
|
||
@Override | ||
public AddressBook load() throws StorageOperationException { | ||
return null; |
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.
👍
Ack by closing PR |
1 similar comment
Ack by closing PR |
No description provided.