SlideShare a Scribd company logo
1 of 13
Download to read offline
Dagger Hilt:
Live Demo, Pros and Cons
Vasiliy Zukanov
Android developer and instructor
Twitter: VasiliyZukanov
Site: TechYourChance.com
@VasiliyZukanov 2
Questions after the session in Zoom,
or on Twitter @VasiliyZukanov (next 24 hours)
Dagger – DI framework by Square
Dagger 2 – DI framework by Google
dagger.android – extension of Dagger 2 by Google
Hilt – abstraction over Dagger 2 by Google
@VasiliyZukanov 3
History of Dagger
Migrate the tutorial app from Dagger 2 to Hilt
Discuss Hilt’s pros and cons
Should you adopt or refactor to Hilt right now?
Future predictions (also known as “conspiracies”)
My stuff (if time permits)
@VasiliyZukanov 4
Our plan for today
@VasiliyZukanov 5
Tutorial App Review
https://github.com/techyourchance/android_summit_2020_tutorial
Activities and Fragments
Application Scope
Activity Scope
Presentation Scope
or
Controller Scope
(unscoped)
AppComponent AppModule
ActivityComponent ActivityModule
PresentationComponent PresentationModule
ViewModelModule
@VasiliyZukanov 7
Migration from Dagger 2 to Hilt
It’ll be very quick, so don’t fixate on the details
Activities and Fragments
Application Scope
Activity Scope
Presentation Scope
or
Controller Scope
(unscoped)
SingletonComponent AppModule
ActivityComponent ActivityModule
@AndroidEntryPoint
@InstallIn
@InstallIn
Hilt Pros and Cons
@VasiliyZukanov 9
Cons:
• Hilt requires additional annotation
processor
• Yet another annotation processor for
ViewModel handling
• Complexity leaks in non-trivial cases (e.g.
FragmentFactory)
• Gradle plugin (optional)
• Immaturity
Pros:
• Better conventions than dagger.android
• Simpler handling of ViewModels and
SavedStateHandle
• Standardization
• Simpler integration, UI and E2E testing *
• Better documentation **
@VasiliyZukanov 10
Do you need to migrate to Hilt?
To me, Hilt doesn’t provide any benefits at this point…
…but I never adopted dagger.android…
@VasiliyZukanov 11
If Hilt doesn’t bring new capabilities, why Google pushes it
so hard?
*speculation (conspiracy) warning*
IMO, 50%+ probability that Hilt will support KMP projects
@VasiliyZukanov 12
If you’re interested in professional-grade Android
development content…
www.TechYourChance.com
Thank you!

More Related Content

What's hot

API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsAPI Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsLes-Tilleuls.coop
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesGanesh Samarthyam
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on androidBenjamin Cheng
 
API Testing following the Test Pyramid
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test PyramidElias Nogueira
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Priyanka Tyagi
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Arif Amirani
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_jsMicroPyramid .
 
The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!Baharika Sopori
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactRob Quick
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | EdurekaEdureka!
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessBartosz Kosarzycki
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfJosé Paumard
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using AppiumMindfire Solutions
 
React Context API
React Context APIReact Context API
React Context APINodeXperts
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshowNhan Cao
 

What's hot (20)

API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsAPI Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
API Testing following the Test Pyramid
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test Pyramid
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
 
Porque flutter
Porque flutter Porque flutter
Porque flutter
 
Gradle
GradleGradle
Gradle
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | Edureka
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
 
Flutter
FlutterFlutter
Flutter
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdf
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
React Context API
React Context APIReact Context API
React Context API
 
React context
React context  React context
React context
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
 

Similar to Dagger Hilt Pros and Cons - Android Summit 2020

Augmented Reality with Project Tango - Droidcon 2016 Berlin
Augmented Reality with Project Tango - Droidcon 2016 BerlinAugmented Reality with Project Tango - Droidcon 2016 Berlin
Augmented Reality with Project Tango - Droidcon 2016 BerlinDominik Helleberg
 
Google Glass By The Numbers
Google Glass By The NumbersGoogle Glass By The Numbers
Google Glass By The NumbersAuggy Augmate
 
Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.PRADA Hsiung
 
CHAOSS Metrics Overview and Examples
CHAOSS Metrics Overview and ExamplesCHAOSS Metrics Overview and Examples
CHAOSS Metrics Overview and ExamplesDawn Foster
 
Flutter technology Based on Web Development
Flutter technology Based on Web Development Flutter technology Based on Web Development
Flutter technology Based on Web Development divyawani2
 
2015 07-17 - Meteor UG Johannesburg - Watchers app
2015 07-17 - Meteor UG Johannesburg - Watchers app2015 07-17 - Meteor UG Johannesburg - Watchers app
2015 07-17 - Meteor UG Johannesburg - Watchers appPaul Sainsbury
 
Basics of the Google Glass programming
Basics of the Google Glass programmingBasics of the Google Glass programming
Basics of the Google Glass programmingMiki Yutani
 
Android Wear CodeLab - GDG Firenze
Android Wear CodeLab - GDG FirenzeAndroid Wear CodeLab - GDG Firenze
Android Wear CodeLab - GDG FirenzeFabio Collini
 
45 Modules in 45 Minutes: The Best Modules You're Not Using
45 Modules in 45 Minutes: The Best Modules You're Not Using45 Modules in 45 Minutes: The Best Modules You're Not Using
45 Modules in 45 Minutes: The Best Modules You're Not Usingultimike
 
Software rotting - 28 Apr - DeveloperWeek Europe 2022
Software rotting - 28 Apr - DeveloperWeek Europe 2022Software rotting - 28 Apr - DeveloperWeek Europe 2022
Software rotting - 28 Apr - DeveloperWeek Europe 2022Giulio Vian
 
A Noob’S Guide To Android Application Development
A Noob’S Guide To Android Application DevelopmentA Noob’S Guide To Android Application Development
A Noob’S Guide To Android Application DevelopmentZi Yong Chua
 
ASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.BgASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.BgDimitar Danailov
 
NASA SpaceApps challenges: Paris Off-the-Grid restitution
NASA SpaceApps challenges: Paris Off-the-Grid restitutionNASA SpaceApps challenges: Paris Off-the-Grid restitution
NASA SpaceApps challenges: Paris Off-the-Grid restitutionRayna Stamboliyska
 
Interim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.comInterim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.combutest
 
Google Glass Seminar Report
Google Glass  Seminar ReportGoogle Glass  Seminar Report
Google Glass Seminar ReportHit Esh
 
Group3-Gravitation.pdf
Group3-Gravitation.pdfGroup3-Gravitation.pdf
Group3-Gravitation.pdfVidhanSingh11
 
Build an app for Google Assistant with Dialogflow
Build an app for Google Assistant with DialogflowBuild an app for Google Assistant with Dialogflow
Build an app for Google Assistant with DialogflowAndreaMaglie
 
[Droidcon Paris 2013]Multi-Versioning Android Tips
[Droidcon Paris 2013]Multi-Versioning Android Tips[Droidcon Paris 2013]Multi-Versioning Android Tips
[Droidcon Paris 2013]Multi-Versioning Android TipsKenichi Kambara
 

Similar to Dagger Hilt Pros and Cons - Android Summit 2020 (20)

Descubre Android
Descubre AndroidDescubre Android
Descubre Android
 
Augmented Reality with Project Tango - Droidcon 2016 Berlin
Augmented Reality with Project Tango - Droidcon 2016 BerlinAugmented Reality with Project Tango - Droidcon 2016 Berlin
Augmented Reality with Project Tango - Droidcon 2016 Berlin
 
Ionic 2 - O que mudou?
Ionic 2 - O que mudou?Ionic 2 - O que mudou?
Ionic 2 - O que mudou?
 
Google Glass By The Numbers
Google Glass By The NumbersGoogle Glass By The Numbers
Google Glass By The Numbers
 
Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.
 
CHAOSS Metrics Overview and Examples
CHAOSS Metrics Overview and ExamplesCHAOSS Metrics Overview and Examples
CHAOSS Metrics Overview and Examples
 
Flutter technology Based on Web Development
Flutter technology Based on Web Development Flutter technology Based on Web Development
Flutter technology Based on Web Development
 
2015 07-17 - Meteor UG Johannesburg - Watchers app
2015 07-17 - Meteor UG Johannesburg - Watchers app2015 07-17 - Meteor UG Johannesburg - Watchers app
2015 07-17 - Meteor UG Johannesburg - Watchers app
 
Basics of the Google Glass programming
Basics of the Google Glass programmingBasics of the Google Glass programming
Basics of the Google Glass programming
 
Android Wear CodeLab - GDG Firenze
Android Wear CodeLab - GDG FirenzeAndroid Wear CodeLab - GDG Firenze
Android Wear CodeLab - GDG Firenze
 
45 Modules in 45 Minutes: The Best Modules You're Not Using
45 Modules in 45 Minutes: The Best Modules You're Not Using45 Modules in 45 Minutes: The Best Modules You're Not Using
45 Modules in 45 Minutes: The Best Modules You're Not Using
 
Software rotting - 28 Apr - DeveloperWeek Europe 2022
Software rotting - 28 Apr - DeveloperWeek Europe 2022Software rotting - 28 Apr - DeveloperWeek Europe 2022
Software rotting - 28 Apr - DeveloperWeek Europe 2022
 
A Noob’S Guide To Android Application Development
A Noob’S Guide To Android Application DevelopmentA Noob’S Guide To Android Application Development
A Noob’S Guide To Android Application Development
 
ASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.BgASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.Bg
 
NASA SpaceApps challenges: Paris Off-the-Grid restitution
NASA SpaceApps challenges: Paris Off-the-Grid restitutionNASA SpaceApps challenges: Paris Off-the-Grid restitution
NASA SpaceApps challenges: Paris Off-the-Grid restitution
 
Interim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.comInterim Report.docx - vsiogap3d.googlecode.com
Interim Report.docx - vsiogap3d.googlecode.com
 
Google Glass Seminar Report
Google Glass  Seminar ReportGoogle Glass  Seminar Report
Google Glass Seminar Report
 
Group3-Gravitation.pdf
Group3-Gravitation.pdfGroup3-Gravitation.pdf
Group3-Gravitation.pdf
 
Build an app for Google Assistant with Dialogflow
Build an app for Google Assistant with DialogflowBuild an app for Google Assistant with Dialogflow
Build an app for Google Assistant with Dialogflow
 
[Droidcon Paris 2013]Multi-Versioning Android Tips
[Droidcon Paris 2013]Multi-Versioning Android Tips[Droidcon Paris 2013]Multi-Versioning Android Tips
[Droidcon Paris 2013]Multi-Versioning Android Tips
 

Recently uploaded

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 

Recently uploaded (20)

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

Dagger Hilt Pros and Cons - Android Summit 2020

  • 1. Dagger Hilt: Live Demo, Pros and Cons Vasiliy Zukanov Android developer and instructor Twitter: VasiliyZukanov Site: TechYourChance.com
  • 2. @VasiliyZukanov 2 Questions after the session in Zoom, or on Twitter @VasiliyZukanov (next 24 hours)
  • 3. Dagger – DI framework by Square Dagger 2 – DI framework by Google dagger.android – extension of Dagger 2 by Google Hilt – abstraction over Dagger 2 by Google @VasiliyZukanov 3 History of Dagger
  • 4. Migrate the tutorial app from Dagger 2 to Hilt Discuss Hilt’s pros and cons Should you adopt or refactor to Hilt right now? Future predictions (also known as “conspiracies”) My stuff (if time permits) @VasiliyZukanov 4 Our plan for today
  • 5. @VasiliyZukanov 5 Tutorial App Review https://github.com/techyourchance/android_summit_2020_tutorial
  • 6. Activities and Fragments Application Scope Activity Scope Presentation Scope or Controller Scope (unscoped) AppComponent AppModule ActivityComponent ActivityModule PresentationComponent PresentationModule ViewModelModule
  • 7. @VasiliyZukanov 7 Migration from Dagger 2 to Hilt It’ll be very quick, so don’t fixate on the details
  • 8. Activities and Fragments Application Scope Activity Scope Presentation Scope or Controller Scope (unscoped) SingletonComponent AppModule ActivityComponent ActivityModule @AndroidEntryPoint @InstallIn @InstallIn
  • 9. Hilt Pros and Cons @VasiliyZukanov 9 Cons: • Hilt requires additional annotation processor • Yet another annotation processor for ViewModel handling • Complexity leaks in non-trivial cases (e.g. FragmentFactory) • Gradle plugin (optional) • Immaturity Pros: • Better conventions than dagger.android • Simpler handling of ViewModels and SavedStateHandle • Standardization • Simpler integration, UI and E2E testing * • Better documentation **
  • 10. @VasiliyZukanov 10 Do you need to migrate to Hilt? To me, Hilt doesn’t provide any benefits at this point… …but I never adopted dagger.android…
  • 11. @VasiliyZukanov 11 If Hilt doesn’t bring new capabilities, why Google pushes it so hard? *speculation (conspiracy) warning* IMO, 50%+ probability that Hilt will support KMP projects
  • 12. @VasiliyZukanov 12 If you’re interested in professional-grade Android development content… www.TechYourChance.com