-
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-B3]Wang Chi #435
Conversation
- Modify StorageFile class to extend Storage class - Modify Logic to use Storage class - Modify Gui to update changed method name
*/ | ||
private StorageFile initializeStorage() throws StorageFile.InvalidStorageFilePathException { | ||
private Storage initializeStorage() throws StorageFile.InvalidStorageFilePathException { | ||
return new StorageFile(); |
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 job attempting 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
public abstract static class InvalidStoragePathException extends IllegalValueException { | ||
public InvalidStoragePathException(String message) { | ||
super(message); | ||
} |
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 need not be abstract... can include the other exception handler also...
@@ -15,7 +15,7 @@ | |||
/** | |||
* Represents the file used to store address book data. | |||
*/ | |||
public class StorageFile { | |||
public class StorageFile 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.
Can consider letting Storage
deal with exception handling
Ack by closing PR |
No description provided.