Skip to content

Commit

Permalink
Merge pull request #107 from TrungBui32/DeleteComponentCommandUML
Browse files Browse the repository at this point in the history
Delete component command uml
  • Loading branch information
TrungBui32 authored Oct 29, 2024
2 parents 568cb96 + 2528bf6 commit 6e71635
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Binary file added docs/diagrams/DeleteComponentCommand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/diagrams/DeleteComponentCommand.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@startuml
!include Style.puml
group sd DeleteComponentCommand
participant ":DeleteComponentCommand" as C LOGIC_COLOR_3
participant ":AppState" as A LOGIC_COLOR_2
participant ":HashMap<String, String>" as H LOGIC_COLOR_7
participant ":ComponentList" as CL LOGIC_COLOR_6
participant ":CommandResult" as R LOGIC_COLOR_8

[-> C

C -> H : get("n/")
activate H
C <-- H : componentName
deactivate H

opt componentName is null
[<-- C : throw IllegalValueException
end

C -> A : findComponent(componentName)
activate A
A --> C : componentsToDelete
deactivate A

alt componentsToDelete.size() == 0
<-- C : throw ComponentNotFoundException
else componentsToDelete.size() > 1
<-- C : throw DuplicateComponentException
end

C -> A : deleteComponent(componentsToDelete.getComponentArrayList().get(0))
activate A
C <-- A
deactivate A

create R
C -> R : new CommandResult
activate R
C <-- R : CommandResult
deactivate R


[<-- C : CommandResult
end
@enduml

0 comments on commit 6e71635

Please sign in to comment.