Clean Architecture
Introduced by Robert C. Martin
What is
Clean
Architecture
?
Clean Architecture combines a
group of practices that produces
systems with the following
characteristics:
❏ Testable
❏ UI-Independent
❏ Independent of databases,
frameworks, libraries
Why should I use Clean Architecture?
Architectures allow
decoupling different units of
your code in an organized
manner. That way the code
gets easier to understand,
modify and test.
Clean Architecture may be
complicated - but it`s worth it!
The main and most complicated topic in
Clean Architecture:
➔ The Dependency Inversion (SOLID)
- High-level modules should not depend on low-level modules.
Both should depend on abstractions.
- Abstractions should not depend on details. Details should
depend on abstractions.
UI
UI calls method from
Presenter/Controller.
Presenters
Presenters execute
Use case.
Use Cases
Use case combines
data from Repositories.
Repository
Each repository
returns data from a
data source (Cache or
Remote.
Entities
These describe the
basic data structures
we work it!
Understanding the layers
The layers
Presentation
This module includes
ViewModels and the UI
(Activities & Fragments)
All dependencies from DI
can be connectable in this
module.
Presentation Layer
depends on Domain Layer.
Domain
The most INNER part of
the layers (no
dependencies with other
layers) and it contains
Entities, Use cases &
Repository Interfaces.
Data
This layer contains
Repository
Implementations and 1 or
multiple Data Sources.
Repositories are
responsible to coordinate
data from the different
Data Sources. Data Layer
depends on Domain Layer.
Conclusion
The features of Clean
Architecture:
● Dependency Rule
● Abstraction
● Communication between
layers
Notice!
Deep understanding of the
dependency inversion principle
and how it works then link the
layers properly.
Thank you!
Hope you`ll use these
presentation to find out
about Clean Architecture
and use it to implement
the structure of your
projects!
By Zahra Heydari

Clean Architecture

  • 1.
  • 2.
    What is Clean Architecture ? Clean Architecturecombines a group of practices that produces systems with the following characteristics: ❏ Testable ❏ UI-Independent ❏ Independent of databases, frameworks, libraries
  • 3.
    Why should Iuse Clean Architecture? Architectures allow decoupling different units of your code in an organized manner. That way the code gets easier to understand, modify and test. Clean Architecture may be complicated - but it`s worth it!
  • 4.
    The main andmost complicated topic in Clean Architecture: ➔ The Dependency Inversion (SOLID) - High-level modules should not depend on low-level modules. Both should depend on abstractions. - Abstractions should not depend on details. Details should depend on abstractions.
  • 6.
    UI UI calls methodfrom Presenter/Controller. Presenters Presenters execute Use case. Use Cases Use case combines data from Repositories. Repository Each repository returns data from a data source (Cache or Remote. Entities These describe the basic data structures we work it!
  • 7.
  • 8.
    The layers Presentation This moduleincludes ViewModels and the UI (Activities & Fragments) All dependencies from DI can be connectable in this module. Presentation Layer depends on Domain Layer. Domain The most INNER part of the layers (no dependencies with other layers) and it contains Entities, Use cases & Repository Interfaces. Data This layer contains Repository Implementations and 1 or multiple Data Sources. Repositories are responsible to coordinate data from the different Data Sources. Data Layer depends on Domain Layer.
  • 9.
    Conclusion The features ofClean Architecture: ● Dependency Rule ● Abstraction ● Communication between layers Notice! Deep understanding of the dependency inversion principle and how it works then link the layers properly.
  • 10.
    Thank you! Hope you`lluse these presentation to find out about Clean Architecture and use it to implement the structure of your projects! By Zahra Heydari