Skip to content

Commit

Permalink
Merge pull request #93 from JunLongling/archivecommand
Browse files Browse the repository at this point in the history
Update UML
  • Loading branch information
Dinoman44 authored Oct 24, 2024
2 parents e64d2ac + b93999c commit fac054e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ The following sequence diagram shows how an undo operation goes through the `Log
![StorageClassDiagramWithArchive](images/StorageClassDiagramWithArchive.png)
</div>

<div>

The following sequence diagram shows how a sort command goes through the `Model` component:
![ArchiveSortSequenceDiagram](images/ArchiveSortSequenceDiagram.png)
</div>

--------------------------------------------------------------------------------------------------------------------

Expand Down
82 changes: 82 additions & 0 deletions docs/diagrams/ArchiveSortSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
' Class Diagram showing Model component for Sort
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

package "Model" {
interface "Model" as Model {
+sortPersonList()
+getFilteredPersonList()
...
}

class "ModelManager" as ModelManager {
+sortPersonList()
...
}

class "AddressBook" as AddressBook {
+sortPersons()
...
}

class "UniquePersonList" as UniquePersonList {
-internalList: List<Person>
+sort(Comparator<Person>)
...
}
}

ModelManager .up.|> Model
ModelManager --> "1" AddressBook
AddressBook --> "1" UniquePersonList

note right of ModelManager
Sorts person list based on
specified criteria (name,
deadline, etc.)
end note

@enduml

' Sequence Diagram showing Model interactions during sort
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":SortCommand" as SortCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as ModelManager MODEL_COLOR
participant ":AddressBook" as AddressBook MODEL_COLOR
participant ":UniquePersonList" as UniquePersonList MODEL_COLOR
end box

[-> SortCommand : execute()
activate SortCommand

SortCommand -> ModelManager : sortPersonList()
activate ModelManager

ModelManager -> AddressBook : sortPersons()
activate AddressBook

AddressBook -> UniquePersonList : sort(comparator)
activate UniquePersonList
UniquePersonList --> AddressBook
deactivate UniquePersonList

AddressBook --> ModelManager
deactivate AddressBook

ModelManager --> SortCommand : result
deactivate ModelManager

[<-- SortCommand : CommandResult
deactivate SortCommand

@enduml
Binary file added docs/images/ArchiveSortSequenceDiagram.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 fac054e

Please sign in to comment.