SlideShare a Scribd company logo
Buzzvil Client Modularization
Created by Ethan Yoo
What is the App modularization
Modular programming
● Is a software design technique
● Separates a program into modules according to the functionality
Module
● Is independent and interchangeable
● Contains everything necessary
● Contains only one aspect of the desired functionality
“App Modularization is to modularize the Android App.”
Why do we need to modularize app
● Faster build time
● Separation of concerns
● Fine-grained dependency control
● Improved reusability across other apps
● Improved the ownership & the quality of the codebase
Faster build time
App
Feature
Feature
Library
Library
Build only what we need
Build by Parallel
Feature
Feature
Library
Library
Separation of Concerns
● A basic principle of software design
● Software modules should have distinct responsibilities as much as
possible
Appshell
Feed Locker Tutorial
Auth Ad Content
Fine-grained dependency control
● Reusability
● Scalability
● Testability
Appshell
Feed Locker Tutorial
Auth Ad Content
Improved reusability across other apps
H/S
Feed Locker Tutorial
Auth Ad Content
S/J
Improved the ownership & the quality of the codebase
H/S
Feed Locker Tutorial
Auth Ad Content
S/J
JD MJ Josh
How to modularize
● Modularization by Feature
● Modularization by Library
Modularize by Feature
Feature is a unit of app functionality
App
App
Feature Feature Feature
Modularize by Library
App
Feature Feature Feature
App
Feature Feature Feature
Library Library Library
Make a library module for sharing code
● Appshell Module
● Feature Module
● Library Module
Multi Module Architecture
App
Appshell
Feature Feature Feature
Library Library Library
Appshell Module
Appshell
Feature Feature Feature
Library Library Library
● Dependency Injection
○ Feature Module
○ Library Module
○ Navigator
● Project build script
● Project configs. (ex : APP_KEY)
Feature Module
Appshell
Feature Feature Feature
Library Library Library
● Feature is a unit of app functionality
● Feature module can be divided into more smaller feature modules
○ The smaller is the better
● Boundary depends on stakeholder’s decision
● Feature module is not referred by other feature modules
● Feature module may have the view or not
● Dependency scope should be created for each module
Library Module
Appshell
Feature Feature Feature
Library Library Library
● There can be redandant codes between feature modules
● Redandant codes should be extracted into the library
● Recommendations
○ No business logic for specific feature
○ Stateless
Considerations
● Do we need a core module?
○ Core module is a module that has no state and has removed its business logic completely
● Should android service belong to feature module?
● How can we define auth module?
● Should we design each module to follow a specific architecture?
● Should we make the dynamic feature module?
Should we need a core module?
● Core module is a module that has no state and has removed its business
logic completely
● There are not many modules yet
● It is better to manage Library and Core modules together
Library
Core Library
Core
Feature Feature Feature
Appshell
Should android service belong to feature module?
● Android service
○ Could be a feature module
○ Could be a library module, otherwise
○ Depends on the stakeholder’s decision
How can we define auth module?
Appshell
Feed Locker Tutorial
Auth Ad Content
● Define auth module as a library module that has purely authentic logic
without any feature-specific logic
● Define feed module as a feature module that handles to login using auth
module
Should we design each module to follow a specific architecture?
● Each module can be built with independant architecture
● Some modules have data and domain layer
● Some modules have only one class
● Therefore, no rule can be defined for the architecture we must follow
Should we make the dynamic feature module?
● One of module belongs to the app bundle, being pushed by google
○ Allowing the module not to be installed at the initial installation
○ Reducing the app size
● The key point is the inversion of dependency between app and module
● If we have well architectured modules, we can integrate it easily at anytime
Module Navigation
● Each feature modules don’t know class in another module
● Therefore, navigator should be injected to the feature modules
● How to implement?
○ Reflection
○ DI Interface
○ Jetpack Navigation
Navigation with Reflection (Google)
Google’s example
Navigation with Reflection (Airbnb)
Airbnb’s example
Navigation with Interface
Navigation with Jetpack’s Navigation
Navigation with Jetpack’s Navigation
Navigation with Jetpack’s Navigation
If you wanna more information, visit this
Which implementation of navigation should we choose
● Navigation is one of the most important module on modularization
● Navigation needs changeable abstraction
● Reflection seems to be the best for now
○ There are use case of major company
○ It can implement without any dependencies
● Jetpack’s navigation seems to be restricted yet
Module Communication
● Callback or Listener Interface
● RxJava
● LiveData
Callback or Listener Interface
RxJava
LiveData
LiveData
● Callback or Listener : simple and easy
● RxJava : reactive stream and functional operator
● LiveData : reactive stream and lifecycle management
We do not have to enforce certain principles
Source Repository
● Multirepo vs Monorepo
Monorepo is better
Source Control Management
● Git
○ DVCS
○ Based on Snapshot
○ Sensitive to the size of repository
● Mercurial
○ DVCS
○ Based on Patch
○ Not sensitive to the size of repository
Depends on the code scale.
→ Git is better for now
Branching Strategy
● Git Flow
○ Well-defined branching procedures
○ There can be many conflicts during the merging process.
● Trunk Based Development
○ Always ready to be released
○ Universal versioning
○ Simple merging strategy
Trunk Based Development is better for monorepo.
Git Flow
Trunk Based Development
Version Management
● Do not assign a version to each module
○ Management of each version causes dependency hell
● Just assign only universal version
Build Tool
● Gradle
○ Google Standard
○ Simple and easy
○ Slow in many modules
● Buck
○ Used by Facebook, Uber, and Twitter
○ Challenging configuration
○ Fast in many modules
● Bazel
○ Used by Google
○ Challenging configuration
○ Fast in many modules
Depends on the code scale.
Gradle is better for now
Continuous Integration
● There are so many tools for CI
● It does not matter which tool we use
● The most important part is to build and test the exact modules we need
3rd Party Library
● Dagger
● RxJava
● LiveData
● ViewModel
Just use it
Q & A

More Related Content

What's hot (20)

PDF
How to Implement Micro Frontend Architecture using Angular Framework
RapidValue
 
PPTX
What’s New in Angular 14?
Albiorix Technology
 
PPTX
Introduction to Koltin for Android Part I
Atif AbbAsi
 
PPTX
Angular Unit Testing
Alessandro Giorgetti
 
PPT
Angular Introduction By Surekha Gadkari
Surekha Gadkari
 
PPT
Angular 8
Sunil OS
 
PPTX
AngularJs presentation
Phan Tuan
 
PPT
Lecture 1
Soran University
 
PDF
Angular directives and pipes
Knoldus Inc.
 
PPTX
Angular Components.pptx
AshokKumar616995
 
PDF
Angular 16 – the rise of Signals
Coding Academy
 
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
PPTX
Angularjs PPT
Amit Baghel
 
PPTX
Angular Lazy Loading and Resolve (Route Resolver)
Squash Apps Pvt Ltd
 
PPTX
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
PPTX
Build pipelines with bitbucket for Magento
Rrap Software Pvt Ltd
 
DOCX
Salesforce Testing Resume
Sowmya J
 
PPT
Data Storage In Android
Aakash Ugale
 
PDF
[TECHCON 2019: MOBILE - Android]3.안드로이드 개발자 로드맵
NAVER Engineering
 
PPTX
Android testing
JinaTm
 
How to Implement Micro Frontend Architecture using Angular Framework
RapidValue
 
What’s New in Angular 14?
Albiorix Technology
 
Introduction to Koltin for Android Part I
Atif AbbAsi
 
Angular Unit Testing
Alessandro Giorgetti
 
Angular Introduction By Surekha Gadkari
Surekha Gadkari
 
Angular 8
Sunil OS
 
AngularJs presentation
Phan Tuan
 
Lecture 1
Soran University
 
Angular directives and pipes
Knoldus Inc.
 
Angular Components.pptx
AshokKumar616995
 
Angular 16 – the rise of Signals
Coding Academy
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
Angularjs PPT
Amit Baghel
 
Angular Lazy Loading and Resolve (Route Resolver)
Squash Apps Pvt Ltd
 
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
Build pipelines with bitbucket for Magento
Rrap Software Pvt Ltd
 
Salesforce Testing Resume
Sowmya J
 
Data Storage In Android
Aakash Ugale
 
[TECHCON 2019: MOBILE - Android]3.안드로이드 개발자 로드맵
NAVER Engineering
 
Android testing
JinaTm
 

Similar to Android Modularization (20)

PDF
RealDay: Angular.js
Miguel Schmitz Grazziotin
 
PDF
Choosing the right JavaScript library/framework/toolkit for our project
Hristo Chakarov
 
PDF
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
DevDay Da Nang
 
PDF
Feature Development with jQuery
Michael Edwards
 
PDF
Evolving to Cloud-Native - Anand Rao
VMware Tanzu
 
PPTX
Django PPT.pptx
KhyatiBandi1
 
PDF
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Parth Lawate
 
PDF
Creating An App for 650 million customers v.2.pdf
Dmitry Osipa
 
PPTX
Foster - Getting started with Angular
MukundSonaiya1
 
PDF
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
PPTX
Decoupled drupal + vue.js
Eugene Vozniuk
 
PPTX
Angular vs react
Infinijith Technologies
 
PDF
Android Frameworks: Highlighting the Need for a Solid Development Framework 
Mutual Mobile
 
PDF
Libreplan architecture
LibrePlan Open Web Planning
 
PDF
Benefits of using software design patterns and when to use design pattern
Beroza Paul
 
PDF
Deccan ruby-conf-talk
prchaudhari
 
PDF
Benefits of OSGi in Practise
David Bosschaert
 
PPTX
Modules and Modularization.pptx
PriyankaBhatia66
 
PDF
Multiplier Effect: Case Studies in Distributions for Publishers
Jon Peck
 
RealDay: Angular.js
Miguel Schmitz Grazziotin
 
Choosing the right JavaScript library/framework/toolkit for our project
Hristo Chakarov
 
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
DevDay Da Nang
 
Feature Development with jQuery
Michael Edwards
 
Evolving to Cloud-Native - Anand Rao
VMware Tanzu
 
Django PPT.pptx
KhyatiBandi1
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Parth Lawate
 
Creating An App for 650 million customers v.2.pdf
Dmitry Osipa
 
Foster - Getting started with Angular
MukundSonaiya1
 
DevOps for TYPO3 Teams and Projects
Fedir RYKHTIK
 
Decoupled drupal + vue.js
Eugene Vozniuk
 
Angular vs react
Infinijith Technologies
 
Android Frameworks: Highlighting the Need for a Solid Development Framework 
Mutual Mobile
 
Libreplan architecture
LibrePlan Open Web Planning
 
Benefits of using software design patterns and when to use design pattern
Beroza Paul
 
Deccan ruby-conf-talk
prchaudhari
 
Benefits of OSGi in Practise
David Bosschaert
 
Modules and Modularization.pptx
PriyankaBhatia66
 
Multiplier Effect: Case Studies in Distributions for Publishers
Jon Peck
 
Ad

More from Young-Hyuk Yoo (9)

PDF
Rx java intro
Young-Hyuk Yoo
 
PDF
Retrofit intro
Young-Hyuk Yoo
 
PDF
How to make web based collaborate code editor
Young-Hyuk Yoo
 
PDF
Dagger2 Intro
Young-Hyuk Yoo
 
PDF
Dagger with multi modules
Young-Hyuk Yoo
 
PDF
Dagger in multi module sdk
Young-Hyuk Yoo
 
PDF
Clean architecture intro
Young-Hyuk Yoo
 
PDF
Component, Redux 기반 비디오 구조 제안
Young-Hyuk Yoo
 
PDF
Android QA Process
Young-Hyuk Yoo
 
Rx java intro
Young-Hyuk Yoo
 
Retrofit intro
Young-Hyuk Yoo
 
How to make web based collaborate code editor
Young-Hyuk Yoo
 
Dagger2 Intro
Young-Hyuk Yoo
 
Dagger with multi modules
Young-Hyuk Yoo
 
Dagger in multi module sdk
Young-Hyuk Yoo
 
Clean architecture intro
Young-Hyuk Yoo
 
Component, Redux 기반 비디오 구조 제안
Young-Hyuk Yoo
 
Android QA Process
Young-Hyuk Yoo
 
Ad

Recently uploaded (20)

PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 

Android Modularization

  • 2. What is the App modularization Modular programming ● Is a software design technique ● Separates a program into modules according to the functionality Module ● Is independent and interchangeable ● Contains everything necessary ● Contains only one aspect of the desired functionality “App Modularization is to modularize the Android App.”
  • 3. Why do we need to modularize app ● Faster build time ● Separation of concerns ● Fine-grained dependency control ● Improved reusability across other apps ● Improved the ownership & the quality of the codebase
  • 4. Faster build time App Feature Feature Library Library Build only what we need Build by Parallel Feature Feature Library Library
  • 5. Separation of Concerns ● A basic principle of software design ● Software modules should have distinct responsibilities as much as possible Appshell Feed Locker Tutorial Auth Ad Content
  • 6. Fine-grained dependency control ● Reusability ● Scalability ● Testability Appshell Feed Locker Tutorial Auth Ad Content
  • 7. Improved reusability across other apps H/S Feed Locker Tutorial Auth Ad Content S/J
  • 8. Improved the ownership & the quality of the codebase H/S Feed Locker Tutorial Auth Ad Content S/J JD MJ Josh
  • 9. How to modularize ● Modularization by Feature ● Modularization by Library
  • 10. Modularize by Feature Feature is a unit of app functionality App App Feature Feature Feature
  • 11. Modularize by Library App Feature Feature Feature App Feature Feature Feature Library Library Library Make a library module for sharing code
  • 12. ● Appshell Module ● Feature Module ● Library Module Multi Module Architecture App Appshell Feature Feature Feature Library Library Library
  • 13. Appshell Module Appshell Feature Feature Feature Library Library Library ● Dependency Injection ○ Feature Module ○ Library Module ○ Navigator ● Project build script ● Project configs. (ex : APP_KEY)
  • 14. Feature Module Appshell Feature Feature Feature Library Library Library ● Feature is a unit of app functionality ● Feature module can be divided into more smaller feature modules ○ The smaller is the better ● Boundary depends on stakeholder’s decision ● Feature module is not referred by other feature modules ● Feature module may have the view or not ● Dependency scope should be created for each module
  • 15. Library Module Appshell Feature Feature Feature Library Library Library ● There can be redandant codes between feature modules ● Redandant codes should be extracted into the library ● Recommendations ○ No business logic for specific feature ○ Stateless
  • 16. Considerations ● Do we need a core module? ○ Core module is a module that has no state and has removed its business logic completely ● Should android service belong to feature module? ● How can we define auth module? ● Should we design each module to follow a specific architecture? ● Should we make the dynamic feature module?
  • 17. Should we need a core module? ● Core module is a module that has no state and has removed its business logic completely ● There are not many modules yet ● It is better to manage Library and Core modules together Library Core Library Core Feature Feature Feature Appshell
  • 18. Should android service belong to feature module? ● Android service ○ Could be a feature module ○ Could be a library module, otherwise ○ Depends on the stakeholder’s decision
  • 19. How can we define auth module? Appshell Feed Locker Tutorial Auth Ad Content ● Define auth module as a library module that has purely authentic logic without any feature-specific logic ● Define feed module as a feature module that handles to login using auth module
  • 20. Should we design each module to follow a specific architecture? ● Each module can be built with independant architecture ● Some modules have data and domain layer ● Some modules have only one class ● Therefore, no rule can be defined for the architecture we must follow
  • 21. Should we make the dynamic feature module? ● One of module belongs to the app bundle, being pushed by google ○ Allowing the module not to be installed at the initial installation ○ Reducing the app size ● The key point is the inversion of dependency between app and module ● If we have well architectured modules, we can integrate it easily at anytime
  • 22. Module Navigation ● Each feature modules don’t know class in another module ● Therefore, navigator should be injected to the feature modules ● How to implement? ○ Reflection ○ DI Interface ○ Jetpack Navigation
  • 23. Navigation with Reflection (Google) Google’s example
  • 24. Navigation with Reflection (Airbnb) Airbnb’s example
  • 28. Navigation with Jetpack’s Navigation If you wanna more information, visit this
  • 29. Which implementation of navigation should we choose ● Navigation is one of the most important module on modularization ● Navigation needs changeable abstraction ● Reflection seems to be the best for now ○ There are use case of major company ○ It can implement without any dependencies ● Jetpack’s navigation seems to be restricted yet
  • 30. Module Communication ● Callback or Listener Interface ● RxJava ● LiveData
  • 31. Callback or Listener Interface
  • 34. LiveData ● Callback or Listener : simple and easy ● RxJava : reactive stream and functional operator ● LiveData : reactive stream and lifecycle management We do not have to enforce certain principles
  • 35. Source Repository ● Multirepo vs Monorepo Monorepo is better
  • 36. Source Control Management ● Git ○ DVCS ○ Based on Snapshot ○ Sensitive to the size of repository ● Mercurial ○ DVCS ○ Based on Patch ○ Not sensitive to the size of repository Depends on the code scale. → Git is better for now
  • 37. Branching Strategy ● Git Flow ○ Well-defined branching procedures ○ There can be many conflicts during the merging process. ● Trunk Based Development ○ Always ready to be released ○ Universal versioning ○ Simple merging strategy Trunk Based Development is better for monorepo.
  • 40. Version Management ● Do not assign a version to each module ○ Management of each version causes dependency hell ● Just assign only universal version
  • 41. Build Tool ● Gradle ○ Google Standard ○ Simple and easy ○ Slow in many modules ● Buck ○ Used by Facebook, Uber, and Twitter ○ Challenging configuration ○ Fast in many modules ● Bazel ○ Used by Google ○ Challenging configuration ○ Fast in many modules Depends on the code scale. Gradle is better for now
  • 42. Continuous Integration ● There are so many tools for CI ● It does not matter which tool we use ● The most important part is to build and test the exact modules we need
  • 43. 3rd Party Library ● Dagger ● RxJava ● LiveData ● ViewModel Just use it
  • 44. Q & A