Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clean Architecture & Error Handling

Clean Architecture & Error Handling

Ahtsham Abbasi

October 24, 2022
Tweet

Other Decks in Technology

Transcript

  1. Why Clean Architecture? • Decouples the external components • Works

    with other architectures like MVP, MVC, MVVM • Framework independent
  2. Backend app • Outer most circle • Database code •

    Auth library • 3rd party services
  3. Outputs • Requirement • Exhaustive output • Easy to learn

    • Easy to scale • Different options considered • Kotlin Try • Monadic outputs • Arrow-Kt • Sealed classes
  4. Pifalls to avoid • Returning nulls • Wrapping non-exhaustible data

    in outputs • Callbacks • Exceptions • Base classes
  5. Other Layers Entities Use Cases Repositories View Models User Interface

    Database Rem ote API • Separate models • Aggregate outputs • Avoid exceptions
  6. It is for you, if you want to.. • Manage

    complex and scaling business requirements
  7. It is for you, if you want to.. • Manage

    complex and scaling business requirements • Decouple the external components
  8. It is for you, if you want to.. • Manage

    complex and scaling business requirements • Decouple the external components • Share business logic across platforms
  9. It is for you, if you want to.. • Manage

    complex and scaling business requirements • Decouple the external components • Share business logic across platforms • Increase testability
  10. It is for you, if you want to.. • Manage

    complex and scaling business requirements • Decouple the external components • Share business logic across platforms • Increase testability • Have a framework independent architecture
  11. Resources • Clean Architecture Book by Robert C. Martin •

    https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html • https://elizarov.medium.com/kotlin-and-exceptions-8062f589d07 • https://pusher.com/tutorials/clean-architecture-introduction/