Closed lukaspili closed 6 years ago
The case you're describing isn't supported and, to be honest, with the current intentionally simple design, it's unlikely to ever be supported. This is probably the line of complexity, beyond which you'd be better off going with fully-featured dependency frameworks (e.g. Dagger).
Fair enough. I agree that Kapsule must be kept simple, and this is why I prefer it to any other DI solution on mobile. I would suggest to specify this kind of limitation in the documentation. When migrating from a fully-featured DI framework, this case is pretty common.
Good point, will add that to the documentation.
Hello, It seems I found a bug or a limitation on transitive dependencies between 2 modules:
The dependency flow is:
a.foobar -> b.bar -> a.foo
Result: When injectingDeps.a.foobar
, it throws a NPE because b.bar is null.I didn't dig into Kapsule, but I think it makes sense because when
ModuleA
is built, all dependencies are resolved directly, with a dependency onModuleB
which has itself a dependency onModuleA
.An easy fix would be to split dependencies into 3 modules, in order to not have a "cyclic dependency on Module level". However it would be nice to support this, because this is fine on dependency level.
What do you think? Thanks.