際際滷

際際滷Share a Scribd company logo
New Android Modularisation
CA-Architecture V2.0
Powered by Clapping Ape Mobile Team
Android Modularisation Architecture
Ingredients
 Core Component
 Dependency Component
 Sub Component
 Module
1. Core Component
 App Component , provided by base module Coconut
2. Dependency Component
 UIComponent , responsible for all UI logic, listener, action,
animation in View layer
 DAOComponent , responsible for fetch data source in App ( local
DB, API source, cloud service) in Model layer
3. Sub Component
 SupportSubComponent , component that only depend 1
component for speci鍖c parent component that handle supporting tools
for UI
 Listener Module
 Action Module
 Animation Module
Modules in
Support SubComponent
Listener Module
Action Module
Animation Module
4.a Navigation Module
 Custom module base on work鍖ow from app
 Should be clear and simple code (less code)
 Only provide route movement manager to handle
transition between page (activity/ fragment)
4.b Module
 Interface model layer to fetch data source (DB, Cloud
storage, API)
 Implementation modularisation in model layer
Code Implementation
 De鍖ne all component and module in child Application
class
 Build dagger component and module
 Setup hierarchy component
 De鍖ne method in module in interface as contract class
Pede : BaseApp
Hierarchy component
View layer
Component Interface
Manager
Module
Scope
Action + Listener
call Action Module
call Listener Module
Interface Module
Interface Action module
Interface Listener module
Benchmark
Old vs New
1. Memory Consumption
Old vs New
Old New
72 MB111 MB189.5 MB
145 MB
SCENARIO : Load SignIn page
Indicator Parameters
Old New
2. LOC
(Improve line of code)
LOC
in SignInActivity.java
346 line
Old
LOC
in SignInActivity.java
122 line
New
3. Testable Code
Thank you. (*_*)

More Related Content

Coco architecture v2.0