forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #261 from xCOLOURx/master
Fix Storage Init Diagram
- Loading branch information
Showing
5 changed files
with
172 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
mainframe sd Init Module Plan | ||
|
||
box Main LOGIC_COLOR_T2 | ||
participant ":MainApp" as MainApp LOGIC_COLOR_T2 | ||
|
||
box Database DATABASE_COLOR_T1 | ||
participant "mp:ModulePlan" as ModulePlan DATABASE_COLOR | ||
participant "jsonModulePlan:JsonSerializableModulePlan" as SerializableModulePlan DATABASE_COLOR | ||
participant "mps:ModulePlanStorage" as ModulePlanStorage DATABASE_COLOR | ||
end box | ||
|
||
|
||
box Model MODEL_COLOR_T1 | ||
participant "plan:ModulePlan" as ModulePlan MODEL_COLOR_T1 | ||
end box | ||
|
||
box Commons LOGIC_COLOR_T1 | ||
participant "<<class>>\nJsonutil" as JsonUtil LOGIC_COLOR_T2 | ||
end box | ||
|
||
activate MainApp | ||
|
||
|
||
MainApp -> MainApp : initModelManager() | ||
activate MainApp | ||
|
||
MainApp -> ModulePlanStorage : readModulePlan() | ||
activate ModulePlanStorage | ||
|
||
ModulePlanStorage -> JsonUtil : readJsonFile(filePath, ModulePlanStorage.class) | ||
activate JsonUtil | ||
|
||
create SerializableModulePlan | ||
JsonUtil -> SerializableModulePlan | ||
activate SerializableModulePlan | ||
|
||
|
||
|
||
SerializableModulePlan --> JsonUtil : jsonModulePlan | ||
deactivate SerializableModulePlan | ||
|
||
JsonUtil --> ModulePlanStorage : jsonModulePlan | ||
deactivate JsonUtil | ||
|
||
ModulePlanStorage -> SerializableModulePlan : toModelType() | ||
activate SerializableModulePlan | ||
|
||
create ModulePlan | ||
SerializableModulePlan -> ModulePlan | ||
activate ModulePlan | ||
|
||
ModulePlan --> SerializableModulePlan : mp | ||
deactivate ModulePlan | ||
|
||
|
||
SerializableModulePlan --> ModulePlanStorage : mp | ||
deactivate SerializableModulePlan | ||
|
||
ModulePlanStorage --> MainApp : mp | ||
deactivate ModulePlanStorage | ||
|
||
MainApp --> MainApp : model | ||
|
||
deactivate MainApp | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
docs/diagrams/StorageInitStorageManagerSequanceDiagram.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
mainframe sd Init Storage Manager | ||
|
||
box Main LOGIC_COLOR_T2 | ||
participant ":MainApp" as MainApp LOGIC_COLOR_T2 | ||
|
||
box Database DATABASE_COLOR_T1 | ||
participant "mps:ModulePlanStorage" as ModulePlanStorage DATABASE_COLOR | ||
end box | ||
|
||
box Storage MODEL_COLOR_T2 | ||
participant "storage:StorageManager" as StorageManager MODEL_COLOR_T2 | ||
|
||
activate MainApp | ||
|
||
MainApp -> ModulePlanStorage | ||
activate ModulePlanStorage | ||
|
||
ModulePlanStorage --> MainApp : mps | ||
deactivate ModulePlanStorage | ||
|
||
|
||
MainApp -> StorageManager : StorageManager(ModulePlanStorage, UserPrefsStorage) | ||
activate StorageManager | ||
|
||
StorageManager --> MainApp : storage | ||
deactivate StorageManager | ||
|
||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
mainframe sd Init User Pref | ||
|
||
box Main LOGIC_COLOR_T2 | ||
participant ":MainApp" as MainApp LOGIC_COLOR_T2 | ||
|
||
box Database DATABASE_COLOR_T1 | ||
participant "ups:UserPrefsStorage" as UserPrefsStorage DATABASE_COLOR | ||
participant "up:UserPrefs" as UserPrefs DATABASE_COLOR | ||
end box | ||
|
||
box Commons LOGIC_COLOR_T1 | ||
participant "<<class>>\nJsonutil" as JsonUtil LOGIC_COLOR_T2 | ||
end box | ||
|
||
activate MainApp | ||
|
||
MainApp -> MainApp : initConfig(config) | ||
activate MainApp | ||
MainApp --> MainApp : config | ||
deactivate MainApp | ||
|
||
MainApp -> UserPrefsStorage : JsonUserPrefsStorage() | ||
activate UserPrefsStorage | ||
|
||
UserPrefsStorage --> MainApp : ups | ||
deactivate UserPrefsStorage | ||
|
||
MainApp -> MainApp : initPrefs(ups) | ||
activate MainApp | ||
|
||
MainApp -> UserPrefsStorage : ups.readUserPrefs() | ||
activate UserPrefsStorage | ||
|
||
UserPrefsStorage -> JsonUtil : readJsonFile(filePath, SerializableModulePlan.class) | ||
activate JsonUtil | ||
|
||
create UserPrefs | ||
JsonUtil -> UserPrefs | ||
activate UserPrefs | ||
|
||
UserPrefs --> JsonUtil : up | ||
deactivate UserPrefs | ||
|
||
JsonUtil --> UserPrefsStorage : up | ||
deactivate JsonUtil | ||
|
||
UserPrefsStorage --> MainApp : up | ||
deactivate UserPrefsStorage | ||
|
||
MainApp --> MainApp : up | ||
deactivate MainApp | ||
|
||
|
||
@enduml |