Koin Framework — Provide Room Dependency (Part-5)- Most Underrated Framework🤔

Hey guys, this is gonna be the fifth part of Koin Framework where we will see how to provide the dependency of Room Library. I hope you all are familiar with Room.😁

You can also read the previous articles on koin framework🙂

First let’s create a Table of Users😋

Now next to create a Dao file for our table operation.👌

Now keep the above table in Database,So let’s create a RoomDatabase.😎

Now comes into our main operation i,e, Dependency. So Create a Module file where we will provide the dependency of our Database and Dao.💖

In the above we used single{ } function to provide the singleton dependency of Database and Dao. Now keep this module in startKoin{ } module() function which we have already seen in the first part of this series.😋

Now use above dependency where ever you want , you don’t need to worried about their objects🥰

For a reference you can prefer the below Github repository

That’s all for today my friends,Hope you are loving this series. If you have any doubts feel free to ask in the comment section.Keep learning happy coding , have a nice day 💖

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store