December 2017
Intermediate to advanced
260 pages
7h 34m
English
Tornado FX supports dependency injection. However, you can also look up components using the find function:
val wordController = find(WordController::class)
When the find function is called, the component corresponding to the given class (WordController, in this case) is looked up in a global component registry. If it did not exist prior to the call, it will be created and inserted into the registry before the function returns.
The View and Controller are singletons; dependency injection is used to access the instance of a specific component.
The inject delegate is another mechanism to get the component in a lazy fashion. It is recommended to use the inject delegate as it's a lazy mechanism that means the actual instance ...
Read now
Unlock full access