Skip to content

Instantly share code, notes, and snippets.

@yuizho
Created August 14, 2016 07:22
Show Gist options
  • Save yuizho/9dbc845f77448bc1ef4ddd2fc0de4420 to your computer and use it in GitHub Desktop.
Save yuizho/9dbc845f77448bc1ef4ddd2fc0de4420 to your computer and use it in GitHub Desktop.
binding.puml
@startuml
participant load
participant event
participant viewModel
participant observer
participant bindViewModel
participant view
== Initialization ==
load -> viewModel: create
viewModel -> observer: create
observer --> viewModel
viewModel --> load
load -> bindViewModel: param(viewModel)
bindViewModel -> viewModel: get properties(observer)
viewModel --> bindViewModel
loop observerの数分loop(ViewModel->View)
bindViewModel -> observer: addSubScriber()
observer --> bindViewModel
end
loop observerの数分loop(View->ViewModel)
bindViewModel -> view: event登録 (observerを登録)
view --> bindViewModel
end
== event ==
note right of event
observerオブジェクトが、
各viewオブジェクトに登録されている状態
end note
event -> observer: テキストボックスの\n入力event
observer -> observer: viewModelの値を更新
observer -> view: valueChanged()
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment