Koin - следующий шаг на пути становления проектов полностью на Kotlin. Что внутри Koin? Только DSL и магия Kotlin. Давайте выясним правда ли Dependency Injection + Kotlin + Easy of Use == Koin?
Level Up Your Android Build -Droidcon Berlin 2015Friedger Müffke
A journey of a young entrepreneur through the Android Gradle build system. It explains the groovy and gradle details that are need during the development process of an Android app.
On stage with Volker Leck
Higher Order Components and Render PropsNitish Phanse
Talk given at React foo Hyderabad 2018. Outlines the differences between higher order components and render props. Both being design patterns used primarily to aid reusability of components across a codebase.
Using the SharePoint Framework as a surface to express yourself through client side solutions is great but at some point in time, you will require that this beauty you built interacts with APIs holding data that lives within the Office 365 environment. In this session, you will learn how to utilize and optimize your calls to SharePoint via its REST APIs, to the Microsoft Graph and to external services that you might find useful to deliver a rich experience in your solution. You will also learn about how to simplify those calls using the Community-Driven library PnP JS Core that aims to save your time (and sanity) by simplifying the access to the SharePoint REST APIs and to the Microsoft Graph. Goodbye URLs, hello intellisense!
Запис от лекцията в Софтуерният Университет.
Поговорихме си как лесно и бързо могат да се направи Rest API с Google Cloud Endpoints.
App Engine Source Code: https://github.com/dimitardanailov/cloud-endpoints-demo
Android Source Code: https://github.com/dimitardanailov/cloud-end-points-android-demo
iOS Source Code: https://github.com/mvelikov/GoogleEndPoints
In this event we will walk you through best practices and the practical Implementation of the following topics:
Advantage of Kotlin over Java, Kotlin Coroutines .
What’s new in Android Studio, How to use Motion Layout Editor
NaviGation Architecture component, Vivewmodel, Livedata, Room database, Jetpack Compose,
Material Design Library...etc
App Distribution - Android App bundle over an APK
Level Up Your Android Build -Droidcon Berlin 2015Friedger Müffke
A journey of a young entrepreneur through the Android Gradle build system. It explains the groovy and gradle details that are need during the development process of an Android app.
On stage with Volker Leck
Higher Order Components and Render PropsNitish Phanse
Talk given at React foo Hyderabad 2018. Outlines the differences between higher order components and render props. Both being design patterns used primarily to aid reusability of components across a codebase.
Using the SharePoint Framework as a surface to express yourself through client side solutions is great but at some point in time, you will require that this beauty you built interacts with APIs holding data that lives within the Office 365 environment. In this session, you will learn how to utilize and optimize your calls to SharePoint via its REST APIs, to the Microsoft Graph and to external services that you might find useful to deliver a rich experience in your solution. You will also learn about how to simplify those calls using the Community-Driven library PnP JS Core that aims to save your time (and sanity) by simplifying the access to the SharePoint REST APIs and to the Microsoft Graph. Goodbye URLs, hello intellisense!
Запис от лекцията в Софтуерният Университет.
Поговорихме си как лесно и бързо могат да се направи Rest API с Google Cloud Endpoints.
App Engine Source Code: https://github.com/dimitardanailov/cloud-endpoints-demo
Android Source Code: https://github.com/dimitardanailov/cloud-end-points-android-demo
iOS Source Code: https://github.com/mvelikov/GoogleEndPoints
In this event we will walk you through best practices and the practical Implementation of the following topics:
Advantage of Kotlin over Java, Kotlin Coroutines .
What’s new in Android Studio, How to use Motion Layout Editor
NaviGation Architecture component, Vivewmodel, Livedata, Room database, Jetpack Compose,
Material Design Library...etc
App Distribution - Android App bundle over an APK
These are the slides of my talk at iOSCon 2017: https://skillsmatter.com/skillscasts/9549-architecting-alive-apps
Our apps are ever more alive. They interact with the rest of the world talking to backends and receiving notifications from them. They get their input from us and from other sensors. They are even aware of the location of the device they run in, or its position. But, in our IoT world, they may also detect presence in a room, get the temperature of it, or change the color of its lights.
Sadly enough, many of the apps available today with those capabilities have some architectural limitations:
Many of them are written in a way that is really dependent on a specific hardware.
Some restrict their use cases to whatever is provided by the hardware devices.
And almost all of them expect having a connection with the real device as the only way to test if they work properly.
However, we can also use an advanced architecture, like the Clean Architecture, to create a beautiful, scalable, testable, and robust application. Join Jorge and he will share with you how you can do it!
This is a "Code or it didn't happen" (TM) talk.
This is a presentation given by Dirk-Jan Rutten and Florentijn Hogerwerf at the React-Amsterdam Winter Event held on the 23rd of February 2017 (https://www.meetup.com/React-Amsterdam/events/237423993/).
Home Improvement: Architecture & KotlinJorge Ortiz
Two of the most relevant news from the recent Google IO were the Guide to App Architecture and the adoption of Kotlin as a first-class language. Both have a very positive impact in our applications.
In my talk I introduced and advanced architecture inspired in the Clean Architecture of Uncle Bob and I showed the impact of these two elements.
First I mentioned the components provided for integration with the lifecycle and how that saves a lot of effort to preserve view models or presenters. I briefly covered the methods that we had available until know focusing on the use of a fragment with no view that had the retained instance property set to true.
Then I covered some real scenarios explaining the improvements that Kotlin provide us with. Some examples:
- Conciseness of data classes (and limitations)
- Property observation
- Use of extensions in presentation logic
- Sealed classes for results (as an either-like type)
This is a "Code or it didn't happen" (TM) talk. ;-)
Swift is not only a new programming language to develop software for all Apple products, but it brought a new approach to the iOS development as well. This report is about it. Less theory, maximum of examples.
Agenda:
1. Protocols in Swift vs Objective-C
2. Protocol-oriented programming approach.
3. Abstract example of POP approach
4. UIKit example of POP approach
5. Foundation example of POP approach.
How do you extend a Volto instance? How to use Create-Volto-App for create a basic boilerplate package, how to override components, reuse reducers and actions and create a new ones. How to integrate third party components. Demos and walkthroughs. The Pastanaga SVG icon system. How to add new icons.
In this deck we deploy contract using geth. We obtain ABI and Bytecode through compilation (which is done on Remix). After deploying the contract we can execute functions. A screen capture video is at the end of this deck.
These are the slides of my talk at iOSCon 2017: https://skillsmatter.com/skillscasts/9549-architecting-alive-apps
Our apps are ever more alive. They interact with the rest of the world talking to backends and receiving notifications from them. They get their input from us and from other sensors. They are even aware of the location of the device they run in, or its position. But, in our IoT world, they may also detect presence in a room, get the temperature of it, or change the color of its lights.
Sadly enough, many of the apps available today with those capabilities have some architectural limitations:
Many of them are written in a way that is really dependent on a specific hardware.
Some restrict their use cases to whatever is provided by the hardware devices.
And almost all of them expect having a connection with the real device as the only way to test if they work properly.
However, we can also use an advanced architecture, like the Clean Architecture, to create a beautiful, scalable, testable, and robust application. Join Jorge and he will share with you how you can do it!
This is a "Code or it didn't happen" (TM) talk.
This is a presentation given by Dirk-Jan Rutten and Florentijn Hogerwerf at the React-Amsterdam Winter Event held on the 23rd of February 2017 (https://www.meetup.com/React-Amsterdam/events/237423993/).
Home Improvement: Architecture & KotlinJorge Ortiz
Two of the most relevant news from the recent Google IO were the Guide to App Architecture and the adoption of Kotlin as a first-class language. Both have a very positive impact in our applications.
In my talk I introduced and advanced architecture inspired in the Clean Architecture of Uncle Bob and I showed the impact of these two elements.
First I mentioned the components provided for integration with the lifecycle and how that saves a lot of effort to preserve view models or presenters. I briefly covered the methods that we had available until know focusing on the use of a fragment with no view that had the retained instance property set to true.
Then I covered some real scenarios explaining the improvements that Kotlin provide us with. Some examples:
- Conciseness of data classes (and limitations)
- Property observation
- Use of extensions in presentation logic
- Sealed classes for results (as an either-like type)
This is a "Code or it didn't happen" (TM) talk. ;-)
Swift is not only a new programming language to develop software for all Apple products, but it brought a new approach to the iOS development as well. This report is about it. Less theory, maximum of examples.
Agenda:
1. Protocols in Swift vs Objective-C
2. Protocol-oriented programming approach.
3. Abstract example of POP approach
4. UIKit example of POP approach
5. Foundation example of POP approach.
How do you extend a Volto instance? How to use Create-Volto-App for create a basic boilerplate package, how to override components, reuse reducers and actions and create a new ones. How to integrate third party components. Demos and walkthroughs. The Pastanaga SVG icon system. How to add new icons.
In this deck we deploy contract using geth. We obtain ABI and Bytecode through compilation (which is done on Remix). After deploying the contract we can execute functions. A screen capture video is at the end of this deck.
Do you want to create your own Plone site using Volto?
This talk will guide you through the whole process. From generating the boilerplate with create-volto-app to theming and creating your own views.
CIRCUIT 2015 - Content API's For AEM SitesICF CIRCUIT
Bryan Williams - ICF Interactive
Many sites need to expose their AEM repository content through a flexible remote API whether it be for consumption by mobile apps, third parties, etc. This presentation will walk through setting up a custom, extensible, secure and testable API utilizing various open source tools that are at your disposal.
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays
apidays LIVE Australia 2020 - Building Business Ecosystems
From micro to macro-coordination through domain-centric DDL pipeline
Alex Khilko, CTO of PlayQ Inc.
Serverless Angular, Material, Firebase and Google Cloud applicationsLoiane Groner
Presented at DevFest Florida 2019 - January 19, Orlando, FL.
In this talk we'll learn how to use all the power of Google stack technologies (Angular, Material, Firebase and Google Cloud) to develop a full stack application. We'll learn how we can empower a serverless Angular + Material application with Firebase and reactive programming by using realtime database, Firestore, authentication (with different providers) and Firebase hosting. And we if need any other functionality, we can use Cloud Functions or a NodeJS app. This talk will demonstrate the overview of a real world application (40k users), along with CI configuration and some details of the code (the good parts!).
Similar to Mobile Fest 2018. Кирилл Розов. Insert Koin (20)
Mobile Fest 2018. Enrique López Mañas. TensorFlow for Mobile PoetsMobileFest2018
There is a lot of Hype with ML and AI lately, and TensorFlow is the framework of choice from Google. But as a Mobile Developer you might have asked yourself, how can I benefit from it? In this talk, you will learn your first steps into the fascinating ML world for mobile.During this talk I will show how to set up TensorFlow for Android, and how to perform some initial operations with it:
- Classifying example
- Detection example
- Analyzing example
I will also show a model to develop a Mobile App with a Model and integration TensorFlow (from Zero to App), showcase demos in Android, iOS and Raspberry and showing as well some Real Use Cases.
Mobile Fest 2018. Łukasz Mróz. Let’s make your DATA sexyMobileFest2018
Quite often when architecting an app or implementing a feature, we don’t really think about the Data itself. Sure, we will handle few network requests or database queries but these things just contain some data, we don’t specifically think about the main character. In this talk I will try to show you why Data itself is important and a few tips and tricks on how to manage it
Mobile Fest 2018. Алексей Демедецкий. Отладка с архитектурой Redux на iOSMobileFest2018
Исользование однонаправленной архитектуры открывает новые возможности по исследованию и отладке работающих приложений. На докладе я расскажу про особенности Redux архитектуры, поделюсь опытом её использования и расскажу как она позволяет ускорить отладку и исследование приложений
Mobile Fest 2018. Илья Иванов. Как React-Native перевернул наше представление...MobileFest2018
Как вообще возможно писать по-настоящему нативные мобильные приложения на JavaScript? Мы разберем почему React-Native отличается от гибридных и нативных методов разработки и как в результате получается нативное приложение. Работая уже два года с React-Native, я покажу не только общие концепции, но и так-же как эта технология работает изнутри.
Mobile Fest 2018. Владимир Бондаренко. Почему переход с Apache Cordova на Rea...MobileFest2018
На протяжении последних 5 лет Apache Cordova была надежным инструментом для создания кроссплатформенных бизнес приложений. Он позволяет снизить затраты на разработку, уменьшить время разработки и дать возможность не держать в штате отдельно специалистов под платформы iOS и Android. Данный подход имел ряд недостатков, список которых рос с количеством реализованных проектов. С появлением технологии React Native появилась кроссплатформенная альтернатива технологии Apache Cordova . Наша команда полгода тестировала React Native. Далее мы все последующие проекты перевели на React Native. В этом докладе речь пойдет о причинах этого решения и трудностях работы с каждой из технологий.
Mobile Fest 2018. Yonatan Levin. WTF with Android Background RestrictionsMobileFest2018
With recent Android releases the wild west of endless running threads is over.
No more smoking barrels of "last 5% battery".
You are required to act and seriously consider how you became the excellent citizen of Android device and play side by side with a marshall law of background tasks. Or die trying.
It's a talk we will explore how memory affect a background process, what solutions we have today and how new WorkManager can save our lives and galaxy :)
Mobile Fest 2018. Алексей Лизенко. Make your project great againMobileFest2018
Можно ли улучшить пользовательский опыт и удобство разработки всего лишь оптимизацией Xcode проекта? Рассмотрим методики уменьшения времени запуска приложения и улучшения отзывчивости Xcode (довольно таки) малой кровью.
Mobile Fest 2018. Артем Гетьман. Архитектура обработки ошибок: чистый, быстры...MobileFest2018
Часто возникает вопрос об архитектурно правильном подходе к обработки ошибок. Как сделать так чтобы кода было мало, он был тестируемый и легкий в понимании? Есть много подходов к которым мы уже привыкли и которые используем каждый день, но так уж сложилось что прогресс не стоит на месте и каждый придумывает свои решения. Мы попытались упростить обработку ошибок и сделать её максимально гибкой, для дальнейшего роста проекта.
Mobile Fest 2018. Алеся Подлесная. UX в разработке мобильных приложенийMobileFest2018
Сегодня в любом цифровом продукте на первый план вышел пользовательский опыт и UI-дизайн. При разработке мобильного приложения требования к интерфейсу возрастают в разы. На рынке множество приложений с похожими функциями и только удачная комбинация UX и UI-дизайна приводит к созданию действительно классного продукта. В презентации мы рассмотрим, как не утерять концентрацию на Human-Centered Design в процессе, как разрабатывать кросс-платформенные приложения не хуже нативных, как соблюдать принципы построения UX и UI-дизайна для хорошего мобильного опыта. Надо постоянно помнить о том, что большинство всех мобильных программ популярны благодаря положительным отзывам и принимать все возможные шаги для улучшения UX в мобильных продуктах, над которыми мы работаем.
Mobile Fest 2018. Александр Сергиенко. Flutter - что за зверь такой?MobileFest2018
Все больше и больше появляется статей по поводу этого инструмента и, если вы еще не слышали о нем, то вам стоит уделить ему хотя бы немного вашего времени. Думаю, за небольшое время мы сможем познакомиться с плюсами и минусами его использования, а также рассмотреть примеры кода, что даст понимание, как и когда стоит переходить на Flutter.
Mobile Fest 2018. Fernando Cejas. What Mom Never Told You About Multi-threadingMobileFest2018
When we were little kids, surely there were many taboo topics our moms never mentioned. There is actually a big chance one of those is multi-threading. That is why in this talk we are going to walk together through the different alternatives we have nowadays in order to handle, manage and master multi-threading on mobile platforms. Our focus will be mainly Android but all the content and techniques exposed here can be also used within other platforms for software engineering threading problem solving. Jump in!
Mobile Fest 2018. Håvard Hvassing. Working with sharp tools — continuous inte...MobileFest2018
I talked about continuous integration and deployment of the working tool for a sales force in 22 different countries. A talk about how we outgrew detailed specifications and rigid structures, and replaced them with transparency and a better common understanding of what we are trying to do accomplish, and the tools we are using. Most importantly, what we have learned a lot about reducing friction
Mobile Fest 2018. Александр Корин. БолеутоляющееMobileFest2018
Наш код - это наша боль. Как бы крут он не был, как бы хорошо не был написан, возвращаясь к нему через год мы ощущаем стыд за то, что мы натворили. За несколько лет сей стыд перерастает в боль за бессмыссленно потраченное время жизни. Мы обсудим болеутоляющие, данные нам возможностями Swift и моим больным воображением
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
Delivering Micro-Credentials in Technical and Vocational Education and TrainingAG2 Design
Explore how micro-credentials are transforming Technical and Vocational Education and Training (TVET) with this comprehensive slide deck. Discover what micro-credentials are, their importance in TVET, the advantages they offer, and the insights from industry experts. Additionally, learn about the top software applications available for creating and managing micro-credentials. This presentation also includes valuable resources and a discussion on the future of these specialised certifications.
For more detailed information on delivering micro-credentials in TVET, visit this https://tvettrainer.com/delivering-micro-credentials-in-tvet/
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
3. Kiev 2018Insert Koin
Inversion of Control (IoC) is a design
principle in which custom-written portions
of a computer program receive the flow of
control from a generic framework
wikipedia.org/wiki/Inversion_of_control
12. Kiev 2018Insert Koin
Sample
val sampleModule = applicationContext {
bean { ComponentA() }
}
class Application : KoinComponent {
val component by inject<ComponentA>()
}
13. Kiev 2018Insert Koin
Sample
val sampleModule = applicationContext {
bean { ComponentA() }
}
class Application : KoinComponent {
val component by inject<ComponentA>()
}
14. Kiev 2018Insert Koin
Sample
val sampleModule = applicationContext {
bean { ComponentA() }
}
class Application : KoinComponent {
val component by inject<ComponentA>()
}
fun main(vararg args: String) {
startKoin(listOf(sampleModule))
}
15. Kiev 2018Insert Koin
Init
class SampleApplication : Application() {
override fun onCreate() {
startKoin(this, listOf(sampleModule))
}
}
fun main(vararg args: String) {
start(listOf(sampleModule)) { … }
}
fun main(vararg args: String) {
startKoin(listOf(sampleModule))
}
16. Kiev 2018Insert Koin
KoinComponent
fun <T> KoinComponent.inject(name: String) : Lazy<T>
fun <T> KoinComponent.inject(name: String, paras: Parameters) : Lazy<T>
fun <T> KoinComponent.property(key: String) : T
fun <T> KoinComponent.property(key: String, defaultValue: T) : T
fun <T> KoinComponent.get(name: String) : T
fun <T> KoinComponent.get(name: String, params: Parameters) : T
fun KoinComponent.setProperty(key: String, value: Any)
fun KoinComponent.releaseContext(name: String)
fun KoinComponent.releaseProperties(vararg keys: String)
interface KoinComponent
17. Kiev 2018Insert Koin
KoinComponent
fun <T> KoinComponent.inject(name: String) : Lazy<T>
fun <T> KoinComponent.inject(name: String, paras: Parameters) : Lazy<T>
fun <T> KoinComponent.property(key: String) : T
fun <T> KoinComponent.property(key: String, defaultValue: T) : T
fun <T> KoinComponent.get(name: String) : T
fun <T> KoinComponent.get(name: String, params: Parameters) : T
fun KoinComponent.setProperty(key: String, value: Any)
fun KoinComponent.releaseContext(name: String)
fun KoinComponent.releaseProperties(vararg keys: String)
18. Kiev 2018Insert Koin
KoinComponent
fun <T> ComponentCallbacks.inject(name: String) : Lazy<T>
fun <T> ComponentCallbacks.inject(name: String, paras: Parameters) : Lazy<T>
fun <T> ComponentCallbacks.property(key: String) : T
fun <T> ComponentCallbacks.property(key: String, defaultValue: T) : T
fun <T> ComponentCallbacks.get(name: String) : T
fun <T> ComponentCallbacks.get(name: String, params: Parameters) : T
fun ComponentCallbacks.setProperty(key: String, value: Any)
fun ComponentCallbacks.releaseContext(name: String)
fun ComponentCallbacks.releaseProperties(vararg keys: String)
34. Kiev 2018Insert Koin
Properties Sources
• koin.properties in JAR resources
• koin.properties in assets
• Environment properties
35. Kiev 2018Insert Koin
Environment variables
startKoin(useEnvironmentProperties = true)
// Get user name from properties
val key1Property: String by property(“USER”)
59. Kiev 2018Insert Koin
Tests
class SampleTest : KoinTest {
val presenter : MyPresenter by inject()
val repository : Repository by inject()
@Before
fun before(){
startKoin(listOf(myModule))
}
@Test
fun testSayHello() {
val hello = repository.giveHello()
assertEquals(hello, presenter.sayHello())
}
@After
fun after(){
closeKoin()
}
}
60. Kiev 2018Insert Koin
Tests
class SampleTest : KoinTest {
val presenter : MyPresenter by inject()
val repository : Repository by inject()
@Before
fun before(){
startKoin(listOf(myModule))
}
@Test
fun testSayHello() {
val hello = repository.giveHello()
assertEquals(hello, presenter.sayHello())
}
@After
fun after(){
closeKoin()
}
}
61. Kiev 2018Insert Koin
Tests
class SampleTest : KoinTest {
val presenter : MyPresenter by inject()
val repository : Repository by inject()
@Before
fun before(){
startKoin(listOf(myModule))
}
@Test
fun testSayHello() {
val hello = repository.giveHello()
assertEquals(hello, presenter.sayHello())
}
@After
fun after(){
closeKoin()
}
}
62. Kiev 2018Insert Koin
Tests
class SampleTest : KoinTest {
val presenter : MyPresenter by inject()
val repository : Repository by inject()
@Before
fun before(){
startKoin(listOf(myModule))
}
@Test
fun testSayHello() {
val hello = repository.giveHello()
assertEquals(hello, presenter.sayHello())
}
@After
fun after(){
closeKoin()
}
}
71. Kiev 2018Insert Koin
ViewModel with arguments
class DetailViewModel(id: String) : ViewModel()
class DetailFactory(val id: String) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
if (modelClass == DetailViewModel::class.java) {
return DetailViewModel(id) as T
}
error("Can't create ViewModel for class='$modelClass'")
}
}
72. Kiev 2018Insert Koin
ViewModel with arguments
class DetailViewModel(id: String) : ViewModel()
class DetailFactory(val id: String) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
if (modelClass == DetailViewModel::class.java) {
return DetailViewModel(id) as T
}
error("Can't create ViewModel for class='$modelClass'")
}
}
class ListFragment : Fragment() {
val listViewModel = provideViewModel<DetailViewModel>(DetailFactory(id))
}
76. Kiev 2018Insert Koin
What missed from Dagger 2?
• Compile time validation
• Features
• Multibindings
• Async Injection
• Reusable scope
77. Kiev 2018Insert Koin
Why use Koin?
• Dagger 2 is too complex for start with DI
• No need Dagger 2 advanced features
• Single place of dependencies declaration
• DSL is amazing for dependencies declaration
• Support Kotlin Multiplatform projects
• Faster build time
• Pure Kotlin code