From d726cb43c6a11fcf8c362b4691430e25c5605bb9 Mon Sep 17 00:00:00 2001 From: Wilson Lee Jun Wei Date: Mon, 10 Apr 2023 20:20:33 +0800 Subject: [PATCH] Add Seq Diagram for Store --- docs/DeveloperGuide.md | 2 +- docs/UmlFiles/Store.puml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 678a11d7e5..5bb1eb7732 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -340,7 +340,7 @@ Step 3. The `storeNotes` public method will then store the note item input by us Sequence Diagram for Store
- +![img.png](SequenceDiagrams/Store_sequence_diagram.png)
diff --git a/docs/UmlFiles/Store.puml b/docs/UmlFiles/Store.puml index e69de29bb2..b216786691 100644 --- a/docs/UmlFiles/Store.puml +++ b/docs/UmlFiles/Store.puml @@ -0,0 +1,27 @@ +@startuml +'https://plantuml.com/sequence-diagram + +@startuml +title Sequence Diagram for Store +actor User + +User -> ":Store" **: Store(notes, toDo) +User -> ":Store":storeNotes() +activate ":Store" +alt isInvalidTodo(toDo) is "Invalid todo" + ":Store" -> ":Ui" : Ui.printIncorrectFormatEntered() + activate ":Ui" + deactivate ":Ui" + else + ":Store" -> ":notes": notes.add(toDo) + activate ":notes" + deactivate ":notes" + ":Store" -> ":Ui": Ui.printAddNote(toDo, notes.getSize()); + activate ":Ui" + deactivate ":Ui" + ":Store" -> ":NotesFileWriter": NotesFileWriter.saveFile(filePath, notes.getAll()) + activate ":NotesFileWriter" + deactivate ":NotesFileWriter" + end +deactivate ":Store" +@enduml \ No newline at end of file