Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2021S1#107 from gabztcr/gabriel-devel…
Browse files Browse the repository at this point in the history
…oper-guide-implementation

Add Overall Completion Percentage feature to DG Implementation
  • Loading branch information
gabztcr authored Oct 28, 2020
2 parents 6227a24 + 2779c80 commit 46d0e44
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,39 @@ The following sequence diagram shows how the view operation works:
* Pros: Does not require an additional operation to fetch the item in view.
* Cons: Inappropriate use of Command Result whose primary objective is to pass feedback to the user.

### \[Proposed\] Overall Completion Percentage feature

#### Proposed Implementation

The Overall Completion Percentage (OCP) feature is to be implemented in the Dashboard page (coming soon) of *Productiv*.
This feature allows users to have a quick overview of the progress of their product's development. OCP is given by the
formula*:

<div markdown="span" class="alert alert-primary">:bulb: **Tip:**
*OCP (%) = Number of Completed Deliverables / Total Number of Deliverables × 100*
</div>

\* If no deliverables are present, OCP will be set to **0%**.

The OCP will only be updated upon successful execution of the following (simplified) commands:
* AddCommand, i.e. *add(deliverable)*
* DoneCommand, i.e. *done(deliverable)*
* DeleteCommand, i.e. *delete(deliverable)*

The following proposed sequence diagram shows how the updating of the OCP would be implemented:

![OCPSequenceDiagram](images/OCPSequenceDiagram.png)

#### Design consideration:

##### Aspect: How updating of OCP executes

* **Alternative 1 (current choice):** Store the deliverable counters within `LogicDeliverableManager`.
* Pros: Adheres to Single Responsibility Principle.
* Cons: May require additional interfaces/methods to retrieve the required values for OCP computation.
* **Alternative 2:** Store the deliverable counters as global variables.
* Pros: Directly accesses the required values for OCP computation.
* Cons: May violate Single Responsibility Principle.


--------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ traditional GUI apps.

1. Ensure you have Java `11` or above installed in your computer.

1. Download the latest `Productiv.jar`. [Coming Soon]
1. Download the latest `Productiv.jar` from [here](https://github.com/AY2021S1-CS2103T-F11-2/tp/releases).

1. Copy the `.jar` file to your preferred folder.

Expand Down
67 changes: 67 additions & 0 deletions docs/diagrams/OCPSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@startuml
!include style.puml

box Model MODEL_COLOR_T1
participant ":DeliverableModel" as Mod MODEL_COLOR
end box

box Logic LOGIC_COLOR_T1
participant ":TotalNumDeliverables" as Total LOGIC_COLOR
participant ":NumCompletedDeliverables" as Com LOGIC_COLOR
participant ":OCP" as OCP LOGIC_COLOR
end box

[-> Mod: add(deliverable)
activate Mod
Mod -> Total : add(1)
activate Total
Total -> OCP : update()
activate OCP
OCP --> Total
deactivate OCP
Total --> Mod
deactivate Total
[<-- Mod
deactivate Mod

[-> Mod: done(deliverable)
activate Mod
Mod -> Com : add(1)
activate Com
Com -> ":OCP" as OCP: update()
activate OCP
OCP --> Com
deactivate OCP
Com --> Mod
deactivate Com
[<-- Mod
deactivate Mod

[-> Mod: delete(deliverable)
activate Mod

opt isCompleted(deliverable)

Mod -> Com : sub(1)
activate Com
Com -> ":OCP" as OCP: update()
activate OCP
OCP --> Com
deactivate OCP
Com --> Mod
deactivate Com

end

Mod -> Total : sub(1)
activate Total
Total -> ":OCP" as OCP: update()
activate OCP
OCP --> Total
deactivate OCP
Total --> Mod
deactivate Total

[<-- Mod
deactivate Mod
@enduml
Binary file added docs/images/OCPSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 46d0e44

Please sign in to comment.