-
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][F14-B2] Zhang Ying #509
base: master
Are you sure you want to change the base?
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.
@Zing1996 good job!!
import seedu.addressbook.data.AddressBook; | ||
import seedu.addressbook.storage.StorageFile.StorageOperationException; | ||
|
||
public abstract class 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.
This class and its methods should have a header comments. If not, developers who needs to inherit from this class will not know how exactly they should override the methods and other developers who write client code for this class will not know how to use it either.
|
||
public abstract class Storage { | ||
public abstract AddressBook load() throws StorageOperationException, seedu.addressbook.storage.StorageStub.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.
It is better to give the method header comments in the parent class rather than the child class. The child class can inherit the comment from the parent.
* Loads data from this storage file. | ||
* @throws StorageOperationException | ||
*/ | ||
public AddressBook load() throws StorageOperationException { |
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.
Stubs don't usually do any work. So preferably, it should be empty.
@@ -28,13 +29,13 @@ | |||
@Rule | |||
public TemporaryFolder saveFolder = new TemporaryFolder(); | |||
|
|||
private StorageFile saveFile; | |||
private StorageStub saveFile; | |||
private AddressBook addressBook; | |||
private Logic logic; | |||
|
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.
I notice your test case failed and i think that it is because you compare the file content... You shouldn't because stub doesnt save :P
No description provided.