Skip to content

Commit

Permalink
Merge f281af0 into 85103b3
Browse files Browse the repository at this point in the history
  • Loading branch information
QzSG committed Nov 6, 2018
2 parents 85103b3 + f281af0 commit 642cea4
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/AboutUs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ We are a team based in the http://www.comp.nus.edu.sg[School of Computing, Natio
//TODO: Portfolio for everyone
=== Adrian Tan Guo Hua
image::qzsg.png[width="150", align="left"]
{empty}[https://qz.sg[homepage]] [https://github.com/qzsg[github]] [<<adrian#, portfolio>>]
{empty}[https://qz.sg[homepage]] [https://github.com/qzsg[github]] [<<qzsg#, portfolio>>]

Role: Team Lead, Developer, Git Expert +
Responsibilities: Devops, Integration, Scheduling and tracking
Responsibilities: DevOps, Integration, Scheduling and tracking

'''

Expand Down
55 changes: 50 additions & 5 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= AddressBook Level 4 - Developer Guide
= Student Planner - Developer Guide
:site-section: DeveloperGuide
:toc:
:toc-title:
Expand Down Expand Up @@ -396,6 +396,22 @@ Backup requires the current in memory book data inside the `Model`, however the

The raised event is observed and handled by the storage manager which performs the backup (either local or through supported online services) using the books from the `model` passed in through the `OnlineBackupEvent` or `LocalBackupEvent`

The _Sequence Diagram_ below shows how the components interact for the scenario where the user issues the local backup command `backup`.

.Component interactions for `backup` command (local backup)
image::SDforBackupLocalwithEventHandling.png[width="800"]

[NOTE]
Note how `Logic` simply raises a `LocalBackupEvent` instead of posting the backup request from the `Model`. This is because `logic` has the `model`
and can simply pass the required data along in the event to `storage` directly.
The event is propagated through the `EventsCenter` to the `Storage` and `UI` bypassing the `Model`

The _Sequence Diagram_ below shows how the components interact for the scenario where the user issues the online github backup command `backup GITHUB AUTH_TOKEN`.

image::SDforBackupOnlinewithEventHandlingPart1.png[width="800"]
.Component interactions for `backup GITHUB AUTH_TOKEN` command (online github backup)
image::SDforBackupOnlinewithEventHandlingPart2.png[width="800"]

===== Aspect: Implementation of performing backup

* **Alternative 1 (current choice):** Performing backup of data files using worker threads.
Expand Down Expand Up @@ -458,8 +474,39 @@ In this example, `GithubStorage#saveContentToStorage` is called for the respecti
. A `UserPrefsChangedEvent` is fired which is handled by `Storage` which saves the updated `UserPrefs` to storage.
. A `NewNotificationAvailableEvent` is also fired. This event is handled by the `UiManager` which calls `showNotification` that creates a new notification and shows
it to the user.

=== Restore Feature
==== Restore Types
The application supports both local and online restore of backup made using the `backup` feature

==== Design Considerations
===== Aspect: How is the backup command initiated
The backup mechanism is unique from the other command implementation as the execution of a `BackupCommand` uses an event driven approach to activate a backup request instead of going through the model manager. Backup command is executed this way
because of the following reason.

Backup requires the current in memory book data inside the `Model`, however the `execute` function is actually passed our `model` containing the required books data. We can raise a backup event directly with the books data provided in the model we have access too

The raised event is observed and handled by the storage manager which performs the backup (either local or through supported online services) using the books from the `model` passed in through the `OnlineBackupEvent` or `LocalBackupEvent`

The _Sequence Diagram_ below shows how the components interact for the scenario where the user issues the local backup command `backup`.

.Component interactions for `backup` command (local backup)
image::SDforBackupLocalwithEventHandling.png[width="800"]

[NOTE]
Note how `Logic` simply raises a `LocalBackupEvent` instead of posting the backup request from the `Model`. This is because `logic` has the `model`
and can simply pass the required data along in the event to `storage` directly.
The event is propagated through the `EventsCenter` to the `Storage` and `UI` bypassing the `Model`

The _Sequence Diagram_ below shows how the components interact for the scenario where the user issues the online github backup command `backup GITHUB AUTH_TOKEN`.

image::SDforBackupOnlinewithEventHandlingPart1.png[width="800"]
.Component interactions for `backup GITHUB AUTH_TOKEN` command (online github backup)
image::SDforBackupOnlinewithEventHandlingPart2.png[width="800"]


// end::backuprestore[]
//author
//@@author

// tag::dataencryption[]
=== [Proposed] Data Encryption
Expand Down Expand Up @@ -1015,8 +1062,6 @@ See this https://github.com/se-edu/addressbook-level4/pull/599[PR] for the step-
[appendix]
== User Stories

== User Stories

Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (unlikely to have) - `*`

[width="59%",cols="22%,<23%,<25%,<30%",options="header",]
Expand All @@ -1026,7 +1071,7 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un

|`* * *` |user |add a new task | track the tasks

|`* * *` |user |list the tasks | view all the tasks avaiable
|`* * *` |user |list the tasks | view all the tasks available

|`* * *` |user |update the task | change the task information where necessary

Expand Down
Binary file modified docs/diagrams/ArchitectureDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/HighLevelSequenceDiagrams.pptx
Binary file not shown.
Binary file modified docs/diagrams/StorageComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/images/Architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SDforBackupLocalwithEventHandling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/StorageClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 4 additions & 8 deletions docs/team/adrian.adoc → docs/team/qzsg.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ Student Planner is a all-in-one desktop manager application that allows students

== Summary of contributions

* *Major enhancement*: added *the ability to backup/restore user data*
* *Major enhancement*: added *the ability to backup and restore user data*
** What it does: allows the user to backup current user data both online and locally. Backups can be restored by using the restore command.
** Justification: This feature improves the product significantly because a user may have the app on many desktops and this provides a convenient way to synchronise them among many devices.
** Justification: This feature improves the product significantly because our target users have the app on many desktops and this provides a convenient way to synchronise them among many devices.
** Highlights: This enhancement enables a generic class that can be easily extended by developers to support more types of online backup services in future. It requires an in-depth analysis of design alternatives.
The implementation too was challenging as the backing up of data online may take a long time, existing implementation will cause the application to freeze until any backup is completed.
The current implementation exhibits a working knowledge of multithreading applications, concurrency as well as event driven programming.
The implementation too was challenging as the backing up and restoring of online data may take a long time, existing implementation will cause the application to freeze until any backup is completed.
The current implementation exhibits a working knowledge of multithreaded applications, concurrency, event driven programming as well as GUI application design.
** Credits: GitHub Api by kohsuke.

* *Minor enhancement*: added a user preferences command that allows the user to customise their application preferences such as default backup locations, online backup data location and other application settings.

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_

* *Other contributions*:

** Project management:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import seedu.address.commons.events.BaseEvent;
import seedu.address.model.UserPrefs;

/** Indicates the AddressBook in the model has changed*/
/** Indicates the UserPrefs in the model has changed*/
public class UserPrefsChangedEvent extends BaseEvent {

public final UserPrefs data;
Expand Down

0 comments on commit 642cea4

Please sign in to comment.