Comments (16)
@gzodx the issue with java code is that it requires a JVM which strikes out iOS and any other platform that has no JVM.
Hilt is a wrapper over Dagger. Let's have a look at Kodein
from kotlin-sdk.
Okey @MrIceman
from kotlin-sdk.
I agree with @gzodx implementing this from scratch would be hard to scale. If koin causes unexpected bugs then I guess dagger is a better choice
from kotlin-sdk.
@MrIceman do we want to use dagger or koin ?
from kotlin-sdk.
@akulinski What I don't like about koin is that it resolves dependencies at runtime and can cause unexpected bugs, Dagger on the other hand has a big overhead. What do you think about implementing an own factory per module which holds singleton instances of each repository? E.g.
object BankFactory { val repository: BankRepository by lazy { BankRepositoryImpl(**Injections**) }
After all, this is what Dagger generates and in a too complicated way imo.
from kotlin-sdk.
i dont think we should do this because we have to look at it at scale and it 100 going to grow it best of we use dagger
from kotlin-sdk.
Dagger is implemented in Java, our aim is to be multiplatform in future. What about a Kotlin solution?
https://github.com/Kodein-Framework/Kodein-DI
Does anyone want to do some research and rate it?
from kotlin-sdk.
I don't think dagger being written in java changes anything about it use in multiplaform ,my only problem with koin or Kodein are the fact that they are more of a service locator then a DI lib ,they do all their dependencies graph generation and all on run time which potentially can lead to runtime errors or slow down the app and the main concern once it begins to scale that when it becomes a big overhead to manage
from kotlin-sdk.
We don't have to go through dagger 2 over head we can actually use hilt which take 90% of the boilerplate but if KMM if what our focus is then https://github.com/Kodein-Framework/Kodein-DI would be a better solution @MrIceman
from kotlin-sdk.
Why don't we just delegate the dependency injection to each platform (i.e. Android and iOS) ?
from kotlin-sdk.
The idea to focus on Android first then we target KMM
from kotlin-sdk.
@IanArb from SDK point of view we should offer instances of the specific UseCases / Repositories already to the host app. So the HostApp at the end would only have to call something like
TNBClient.bankManager
and we'd provide the bank manager instance lazy
from kotlin-sdk.
I can create this kind of solution. Will look at in the upcoming weeks and try to build custom factory(ish) pattern to resolve the current challenges and the future ones.
from kotlin-sdk.
Hey @khurramsaeed feel free to take this one and looking forward to your solution!
from kotlin-sdk.
Hey @khurramsaeed just checking in to see if you need any help?
from kotlin-sdk.
Going to close this issue now. We'll be using Dagger.
from kotlin-sdk.
Related Issues (20)
- Implement GET request for confirmation blocks in Primary Validator API
- Implement GET request for Config in Primary Validator API HOT 1
- Implement GET request for Banks for Primary Validator API
- Implement GET requests for Validators for Primary Validator API
- Implement POST request for Connection Requests for Primary Validator API
- Implement GET requests for Accounts endpoint in Confirmation Validator API
- Implement GET request for Confirmation Services endpoint in Confirmation Validator API
- Implement GET request for Banks endpoint in Confirmation Validator HOT 3
- Implement GET clean endpoint in Confirmation Validator API
- Implement POST request for clean endpoint in Confirmation Validator API
- Implement GET request for Config endpoint in Confirmation Validator API
- Implement GET requests for Confirmation Blocks endpoint in Confirmation Validator API
- Implement POST request for confirmation blocks endpoint in Confirmation Validator API
- Implement POST request for Connection Requests in Confirmation Validator API
- Implement GET request for Crawl endpoint in Confirmation Validator API
- Implement POST request for Crawl endpoint in Confirmation Validator API
- Implement POST request for update endpoint in Confirmation Validator API
- Implement POST request for Upgrade endpoint in Confirmation Validator API HOT 2
- Implement GET requests in validators endpoint in Confirmation Validator API
- Provide usage examples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-sdk.