Can anyone explain the "correct" way to replace co...
# tornadofx
a
Can anyone explain the "correct" way to replace code behind? Do you delegate everything to the Controller class instances, so any setOn looks like
setOnAction { controller.action(<args>) }
, or is it better to provide FXEvent and subscribe controller to the event bus:
setOnAction { fireEvent(ActionPerformedEvent) }
(which actually reminds of Qt signal/slot system, but with no direct coupling)? What are the advantages of each method and what are the use cases?