Skip to content
Kaushik Gopal edited this page Dec 5, 2024 · 10 revisions

USF ‐ architecture for mobile apps

USF is a Unidirectional State Flow architecture pattern that is agnostic of platform and can be used for any mobile application.

usf_animation.gif "diagram showing how the USF pattern works"

  • Talks/presentations on this

Goals of this pattern

1. USF is first an architecture concept, not a library

  • The architecture should be independent of platform (use in Android & iOS) so as to be conceptually similar.
  • Conceptually similar is important because it means you can quickly follow this code and use in other platforms.
  • You'll find the android blueprints & USF are modeled very similarly.

2. Don't rely on any single company for your framework

  • While there are fantastic solutions out there, USF should survive if any company decides to stop supporting or maintaining the library.

3. Generated boilerplate should be similar to what you'd otherwise manually write.

  • We want the generated code (if any) to be very similar to something that you would handwrite yourself.
  • Code will strive for legibility first before performance.

Common FAQ

how do we do x

why do we do y

is this used in production anywhere?

  • point to examples
  • Sample Android app
  • Sample iOS app

Detailed FAQ

  • if you have questions on how something would work the USF way, raise an issue
  • i'll try to add more questions

Timeline of pattern's evolution

I first talked about this pattern I gave another talk at Mobilization IX showing how we can use the same concepts on iOS too and wrote my first iOS app to demonstrate these concepts - You can check that out here.

  • 2018: Talked publicly first about USF pattern at MBLT}Dev 2018.
  • 2020: Demonstrated conceptual similarity at Mobilization IX conf using iOS & Android app.
  • 2021: Google introduces their guide to app architecture.
  • 2023: Migrate to Coroutines #29
  • 2023: Use KSP lightweight compiler plugin to reduce boilerplate
  • 2024: Refinements in pattern from prod use at Instacart
Clone this wiki locally