-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed TODOs & created the todo list.
- Loading branch information
1 parent
baa9d89
commit a9ec395
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Kodein DI todo list | ||
=================== | ||
|
||
CORE | ||
---- | ||
|
||
#### Suspending factories | ||
|
||
Factories (such as `factory {}`, `provider {}`, `singleton {}`, etc.) should take suspendable functions as parameter. | ||
|
||
This would enable code such as: | ||
|
||
```kotlin | ||
Kodein { | ||
bind<UserList>() with singleton { api.userList().await() } | ||
} | ||
``` | ||
|
||
This is a **major change**, as retrieval functions must also become suspending functions. | ||
Therefore, we need to provide a way for blocking retrieval to be as easy as `kodein.direct`. | ||
|
||
|
||
FRAMEWORKS | ||
---------- | ||
|
||
#### TornadoFX | ||
|
||
[TornadoFX](https://github.com/edvin/tornadofx) is a JavaFX framework for Kotlin. | ||
|
||
It uses some kind of IoC for binding views, components and controllers. | ||
These bindings could be integrated to Kodein, especially through the `externalSource` feature. | ||
|
||
Further more, Kodein could provide special scopes for TornadoFX (controller, component, etc.). | ||
|
||
#### KTor | ||
|
||
[Ktor](https://ktor.io/) is a framework for building asynchronous servers and clients. | ||
|
||
Kotlin could provide special scopes for KTor servers (session, request, route, etc.). | ||
|
||
#### Cocoa-Touch | ||
|
||
Cocoa Touch is the Core Framework on iOS. | ||
|
||
Kotlin should provide the same kind of services on iOS it provides for Android. | ||
Namely: a module to retrieve core services and scopes for MVC controllers (ViewController on iOS). | ||
|
||
Furthermore, Kodein is currently incompatible with Obj-C & Swift and requires a facade. | ||
This must be addressed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
kodein-di-core/src/allNativeMain/kotlin/org/kodein/di/internal/lang.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package org.kodein.di.internal | ||
|
||
internal actual fun <K, V> newConcurrentMap(): MutableMap<K, V> = HashMap() | ||
internal actual fun <T> newLinkedList(): MutableList<T> = ArrayList() // TODO: This should REALLY be a Linked list ! | ||
internal actual fun <T> newLinkedList(): MutableList<T> = ArrayList() | ||
internal actual fun <T> newLinkedList(c: Collection<T>): MutableList<T> = ArrayList(c) | ||
|
||
actual inline fun <R> maySynchronized(lock: Any?, block: () -> R): R = block() |