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

[T6A1][W09-B4]Dylan Sng #444

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

Conversation

dylansyj
Copy link

Add abstract class Storage.
Allows interaction between Logic and StorageFile class.

@dylansyj dylansyj changed the title Ready for review [T6A1][W09-B4]Dylan Sng Feb 28, 2017
Copy link

@hwkchia hwkchia left a comment

Choose a reason for hiding this comment

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

You seemed to have missed out on the StorageStub?

@@ -45,7 +46,7 @@ void setAddressBook(AddressBook addressBook){
* Creates the StorageFile object based on the user specified path (if any) or the default storage path.
* @throws StorageFile.InvalidStorageFilePathException if the target file path is incorrect.
*/
private StorageFile initializeStorage() throws StorageFile.InvalidStorageFilePathException {
private Storage initializeStorage() throws StorageFile.InvalidStorageFilePathException {
return new StorageFile();
}
Copy link

Choose a reason for hiding this comment

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

👍 Good job in applying DIP.

The creating of StorageFile is a little unfortunate, but nonetheless has to be done. The original design already violates OCP. Fyi, an issue has been raised regarding this se-edu/addressbook-level3#75

import seedu.addressbook.data.AddressBook;
import seedu.addressbook.storage.StorageFile.StorageOperationException;

public abstract class Storage {
Copy link

Choose a reason for hiding this comment

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

Header comment?

@@ -15,7 +15,7 @@
/**
* Represents the file used to store address book data.
*/
public class StorageFile {
public class StorageFile extends Storage{
Copy link

Choose a reason for hiding this comment

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

Ok... may I also suggest moving the exception handling to Storage instead?

@hwkchia
Copy link

hwkchia commented Mar 7, 2017

Ack by closing PR

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

Successfully merging this pull request may close these issues.

2 participants