voddan
10/13/2016, 10:21 AMMain
, which is an App
, which creates a MainView
voddan
10/13/2016, 10:22 AMMain
I initialise MemoryModel
, which is in Java and must not depend or be related to the kotlin codevoddan
10/13/2016, 10:23 AMvoddan
10/13/2016, 10:24 AMMainView
creates UI on init, and it needs an initialised MemoryModel
voddan
10/13/2016, 10:25 AMMain
via FX.application
, but it is not yet initialised at that pointvoddan
10/13/2016, 10:26 AMvoddan
10/13/2016, 10:26 AMedvin
10/13/2016, 10:27 AMedvin
10/13/2016, 10:27 AMedvin
10/13/2016, 10:27 AMedvin
10/13/2016, 10:28 AMApp
would need to know about MemoryModel
. Isn't it MainView
that needs it?voddan
10/13/2016, 10:29 AMvoddan
10/13/2016, 10:29 AMmain
?voddan
10/13/2016, 10:30 AMApp
wrongedvin
10/13/2016, 10:31 AMedvin
10/13/2016, 10:31 AMedvin
10/13/2016, 10:32 AMApp
other than instruct the application to show the MainView.edvin
10/13/2016, 10:32 AMController
is a singleton injectable just like View
, so it is a good place for stuff like the MemoryModelron
10/13/2016, 10:33 AMdoSomethingIfYouNeedTo
in the init of the StateControlleredvin
10/13/2016, 10:33 AMvoddan
10/13/2016, 10:33 AMApp
is the starting point, but Controller
is the controller, right?ron
10/13/2016, 10:34 AMron
10/13/2016, 10:34 AMedvin
10/13/2016, 10:34 AMController
is not THE controller, it's just a controller 🙂 You can have multiple, and they don't have a hard connection to any specific View.voddan
10/13/2016, 10:34 AMApp
was the controlleredvin
10/13/2016, 10:34 AMApp
is just a way to bootstrap the application.voddan
10/13/2016, 10:34 AM