#mobarchclub
Clean Architecture
image from https://8thlight.com
Slide 24
Slide 24 text
Mobile Applications
Architecture
Some specifics. Main complexity levels
Slide 25
Slide 25 text
#mobarchclub
Android Has “Good Bones”
image from https://8thlight.com
Components:
-Activities
-Fragments
-Services
-Content Providers
-Broadcast Receivers
Slide 26
Slide 26 text
#mobarchclub
Mobile has it’s Specifics
image from https://8thlight.com
App-hopping
OS may kill app at random time
App components lifecycle is not under
control
Components should not depend on each
other
Can’t rely on data, stored in components
Slide 27
Slide 27 text
#mobarchclub
Android Activity Lifecycle is like this :)
image from https://8thlight.com
Slide 28
Slide 28 text
#mobarchclub
Common Principles for Mobile
-Separation of concerns
-Provide solid user experience
-Keep UI lean and simple
-Keep UI free of app logic
-Drive UI from model
-Use persistent model
-Assign clear responsibilities model classes
Slide 29
Slide 29 text
#mobarchclub
Separation of Concerns. Abstract way
image from fernandocejas.com
#mobarchclub
Presenter / View Model
Move non-UI logic from controller to another class
Slide 32
Slide 32 text
#mobarchclub
Layer Separation
Move network, database and business logic to
separate layers
Slide 33
Slide 33 text
#mobarchclub
Entities
Separate view from database.
Little or no logic for entities
Slide 34
Slide 34 text
#mobarchclub
Dependency injection
Decouple layers.
Pass dependencies to constructor parameters
Or use injection framework (JSR-330, Dagger, AndroidAnnotations,
Juice, etc.)
Slide 35
Slide 35 text
#mobarchclub
Coordinator
Move navigation logic out of views
Slide 36
Slide 36 text
#mobarchclub
Reactive Programming
Automatically propagate changes between layers
and use mapping between data in functional style
Slide 37
Slide 37 text
Mobile Architecture
Patterns
Common patterns. Not only for Android
Slide 38
Slide 38 text
#mobarchclub
MVC: Model - View - Controller
Slide 39
Slide 39 text
#mobarchclub
MVP: Model - View - Presenter
Slide 40
Slide 40 text
#mobarchclub
MVVM: Model - View - ViewModel
Slide 41
Slide 41 text
#mobarchclub
VIPER
Slide 42
Slide 42 text
#mobarchclub
RIBs
Slide 43
Slide 43 text
#mobarchclub
Architecture Components
Slide 44
Slide 44 text
#mobarchclub
Architecture Components
image from Guide to App Architecture
Slide 45
Slide 45 text
Project Lifecycle.
Agile Architecture
Things outside app that influence architecture evolution
Slide 46
Slide 46 text
#mobarchclub
Minimum Viable Architecture
1. YAGNI = You aren’t going to need it!
2. RT-RJ-RT Use the Right Tool for the Right
Job at the Right Time
3. XP - Change incrementally
#mobarchclub
Search Phase
1. “No architecture at all”
2. Find business model and market fit
3. Acquire first customers
4. Prototype - familiar technology, cobble it together
5. Throw it away later - but not now
Slide 50
Slide 50 text
#mobarchclub
Execution Phase
1. “Just enough” architecture
2. Meet near-term customer needs, delight customers
3. Rapid learning and imporovement
4. Team productivity
5. Monolithic architecture
6. Minimal infrastructure
7. NOT about scaling
Slide 51
Slide 51 text
#mobarchclub
Change drives the world
“The best code you can write now is the code you’ll discard in a
couple of years”
Martin Fowler
#mobarchclub
Scaling Phase
● Scaling the Team
● Scaling the Technology
● Concurrency and Efficiency
Slide 54
Slide 54 text
#mobarchclub
Scaling is the result of the change
“If you don’t end up regretting your early technology decisions, you
probably over-engineered”
Randy Shoup
Slide 55
Slide 55 text
#mobarchclub
Scaling. “Next-Gen” Architecture
● Scaling the Technology. Migrations, Concurrency, Other
languages
● Scalable persistence. Break-up monolithic DB, split to
functional modules
● Identify and eliminate bottlenecks. Increase performance
● Re-Design interfaces
Slide 56
Slide 56 text
Read
Learn and expand
Slide 57
Slide 57 text
#mobarchclub
Read About Software Architecture
Clean Architecture
https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html
Architecture, the Lost Years by Uncle Bob
https://youtu.be/WpkDN78P884
Fernando Cejas - Architecturing Android, Evolution
https://fernandocejas.com/2015/07/18/architecting-android-the-evolution/
Minimum Viable Architecture
https://www.slideshare.net/RandyShoup/minimum-viable-architecture-good-e
nough-is-good-enough-in-a-startup
Mobile
Architecture
Club