Skip to content

Commit

Permalink
updated diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
choonx99 committed Nov 11, 2019
1 parent b34fbd4 commit 6c5612d
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 9 deletions.
6 changes: 0 additions & 6 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ The `Model`,
* stores an `ExchangeData` object that represents the foreign exchange rates for conversion of currencies.
* stores the MYMorise data.
* exposes an unmodifiable `ObservableList<Expense>` and an unmodifiable `ObservableList<Budget>` that can be 'observed' e.g. the UI can be bound to either list so that the UI automatically updates when the data in the list change.
* does not depend on any of the other three components.

[NOTE]
As a more OOP model, we can store a `Tag` list in `Address Book`, which `Person` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Person` needing their own `Tag` object. An example of how such a model may look like is given below. +
+
image:BetterModelClassDiagram.png[]

[[Design-Storage]]
=== Storage component
Expand Down
21 changes: 21 additions & 0 deletions docs/diagrams/AddExpenseActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@startuml
start
:User executes AddExpense command;

'diamond
if () then ([expense does not exist])
'diamond
if () then ([expense falls into a budget period])
: get budget which expense falls into;
: add expense into the budget;

else ([else])
: add expense into default expense list;
endif
:Update UI;
:Save default expense list and budget list;
else ([else])
: user receives expense duplicate message;
endif
stop
@enduml
15 changes: 14 additions & 1 deletion docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ activate ui UI_COLOR
ui -[UI_COLOR]> logic : execute("delete 1")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : deleteExpense(e)
logic -[LOGIC_COLOR]> model : getViewState()
activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model

alt BudgetList
logic -[LOGIC_COLOR]> model : deleteBudget(b)
activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model

else ExpenseList
logic -[LOGIC_COLOR]> model : deleteExpense(e)
activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model
end


logic -[LOGIC_COLOR]> storage : saveMymorise()
activate storage STORAGE_COLOR
Expand Down
23 changes: 23 additions & 0 deletions docs/diagrams/BudgetClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Class Budget
Class Amount
Class Currency
Class Date
Class Name
Class ExpenseList

Budget *--> "1" Name
Budget *--> "2" Amount
Budget *--> "2" Date
Budget *--> "1" Currency
Budget *--> "1" ExpenseList

Name -[hidden]right-> Amount
Amount -[hidden]right-> Date

@enduml
30 changes: 30 additions & 0 deletions docs/diagrams/BudgetObjectDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@startuml
object ":Budget" as o
object "name:Name" as o2
object "currency:Currency" as o3
object "startDate:Date" as o4
object "endDate:Date" as o5
object "amount:Amount" as o6
object "amountLeft:Amount" as o7
object "expenseList:ExpenseList" as o8
object "expenses:UniqueExpenseList" as o9


o2 : fullName = "Japan Travel"
o3 : name = "JPY"
o4 : value = "12 Dec 2019"
o5 : value = "18 Dec 2019"
o6 : value = "9500"
o7 : value = "9500"

o --> o2
o --> o3
o --> o4
o --> o5
o --> o6
o --> o7
o --> o8
o8 --> o9


@enduml
17 changes: 16 additions & 1 deletion docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,23 @@ deactivate MymParser
LogicManager -> DeleteCommand : execute()
activate DeleteCommand

DeleteCommand -> Model : deleteExpense(1)
DeleteCommand -> Model : getViewState()
activate Model
Model --> DeleteCommand
deactivate Model

alt BudgetList
DeleteCommand -> Model : deleteBudget(b)
activate Model
Model --> DeleteCommand
deactivate Model

else ExpenseList
DeleteCommand -> Model : deleteExpense(e)
activate Model
Model --> DeleteCommand
deactivate Model
end

Model --> DeleteCommand
deactivate Model
Expand Down
Binary file added docs/images/AddExpenseActivityDiagram.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 modified docs/images/ArchitectureSequenceDiagram.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/BudgetClassDiagram.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/BudgetObjectDiagram.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 modified docs/images/DeleteSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ private CommandResult executeCommand(String commandText) throws CommandException
expenseListPanel = new ExpenseListPanel(logic.updateExpenses());
//Update Left panel with all expenses.
leftListPanelPlaceHolder.getChildren().add(expenseListPanel.getRoot());
// statsDisplayPlaceHolder.getChildren().add(statsDisplay.getRoot());

if (commandResult.isShowHelp()) {
handleHelp();
Expand Down

0 comments on commit 6c5612d

Please sign in to comment.