There are links in the text to a number of projects that already use KotlinPoet, and I’m sure there’s plenty more in the wild — any specific things you dislike? Do you mean debugging the codegen code, or the generated code?
Thanks for an awesome read!
Unfortunately it is currently not possible to define some arguments as required or optional
I’m watching the I/O session right now, and it looks like you need to set a default value via
app:defaultValue="value" to make an argument optional. Curious to know if this works!
Hey Enrique, thanks for a great read!
I’m not sure I get this point,
lateinit should work just fine with primitive types:
lateinit var myVar: Int
Why are delegates required?
Thanks for a great read, that small program printing out the order of execution is super useful!
Just to point out that this is likely an oversight on the part of the
ProgressBar designers, here’s a quote from Effective Java (copied from this StackOverflow answer):
Constructors must not invoke…
Right, that was my point — dependencies are resolved at runtime. This can fail of course, and it’s always better when things fail at compilation time, rather than crash the apps running on customer’s devices. As I said, solution like Koin might be a good idea for a small app with trivial DI setup: it’s lightweight and elegant. However, I doubt that…
First of all, thanks for your article.
A thing I wanted to point out is that Dagger 2 will fail at compile time whenever the dependency graph is not configured properly. Koin does this:
inline fun <reified T> get(): T = getOrNull<T>() ?: throw InstanceNotFoundException("No instance found for…
Thanks Joaquim! I totally agree that the fact that most of the MVP examples out there try to bake in as much modern technology as possible — RxJava, Dagger, Kotlin, you name it — makes it hard to actually grasp MVP, which is a simple design pattern. Kudos for a project that actually focuses on MVP!
Hey Joaquim, thanks for a great read! I looked into the GitHub repo, and one thing I really like is keeping Model and Presenter layers inside a separate module: this serves as a great demonstration of the core idea of the pattern — making it possible for different frontends to reuse shared business logic. Great job!