P-Y on Nostr: Did you know you can build a Dependency Injection Framework that fits in a toot? ``` ...
Did you know you can build a Dependency Injection Framework that fits in a toot?
```
class Linker {
val factories = mutableMapOf<Class<out Any?>, Linker.() -> Any?>()
}
```
That's it! Yes, it's just a map. A little map of object class keys to object factories.
Can you believe it? Let's explore this in a thread, and build a CoffeeMaker!
#AndroidDev
```
class Linker {
val factories = mutableMapOf<Class<out Any?>, Linker.() -> Any?>()
}
```
That's it! Yes, it's just a map. A little map of object class keys to object factories.
Can you believe it? Let's explore this in a thread, and build a CoffeeMaker!
#AndroidDev