Skip to content

Instantly share code, notes, and snippets.

@Ah-da-Coder
Created September 8, 2019 10:53
Show Gist options
  • Select an option

  • Save Ah-da-Coder/90639ad0d4f5c5b01113becea54080fe to your computer and use it in GitHub Desktop.

Select an option

Save Ah-da-Coder/90639ad0d4f5c5b01113becea54080fe to your computer and use it in GitHub Desktop.
Stateパターンのシーケンス図改良版
@startuml
skinparam ClassAttributeIconSize 0
hide circle
hide empty member
main -> "<u>context</u>\n<u>:Context</u>" : <<create>>
"<u>context</u>\n<u>:Context</u>" -> "<u>the_beginning_of_the_day</u>\n<u>:TheBeginningOfTheDay</u>" : <<create>>
"<u>context</u>\n<u>:Context</u>" -> "<u>the_end_of_the_day</u>\n<u>:TheEndOfTheDay</u>" : <<create>>
"<u>context</u>\n<u>:Context</u>" -> "<u>context</u>\n<u>:Context</u>" : state = the_beginning_of_the_day
group state:the_beginning_of_the_day
main -> "<u>context</u>\n<u>:Context</u>" : context.action()
"<u>context</u>\n<u>:Context</u>" -> "<u>the_beginning_of_the_day</u>\n<u>:TheBeginningOfTheDay</u>" : the_beginning_of_the_day.action()
main -> "<u>context</u>\n<u>:Context</u>" : context.greeting()
"<u>context</u>\n<u>:Context</u>" -> "<u>the_beginning_of_the_day</u>\n<u>:TheBeginningOfTheDay</u>" : the_beginning_of_the_day.greeting()
end
main -> "<u>context</u>\n<u>:Context</u>" : context.change_state()
"<u>context</u>\n<u>:Context</u>" -> "<u>context</u>\n<u>:Context</u>" : state = the_end_of_the_day
group state:the_end_of_the_day
main -> "<u>context</u>\n<u>:Context</u>" : context.greeting()
"<u>context</u>\n<u>:Context</u>" -> "<u>the_end_of_the_day</u>\n<u>:TheEndOfTheDay</u>" : the_end_of_the_day.greeting()
main -> "<u>context</u>\n<u>:Context</u>" : context.action()
"<u>context</u>\n<u>:Context</u>" -> "<u>the_end_of_the_day</u>\n<u>:TheEndOfTheDay</u>" : the_end_of_the_day.action()
end
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment