2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Clean Architecture

Last updated at Posted at 2019-03-27

#Introduction
Clean Architecture Principle is the application's core functionality which separate into three layers:

  1. Presentation Layer: how the data presents to the user
  2. Domain Layer: can be called as use case layer where the core logic of the application.
  3. Data Layer: how data can be accessed.

cleanCode.png

Each layer has its own data model, and data can only be exchanged between layers and usually flow in one direction anytime data needs to be changed. At the data layer, every source of data should be represented using the repository data pattern.

Here is the given example in swift code
Organize Folder
Screen Shot 2019-04-04 at 3.12.29 PM.png

Note: You can structure your folder as you like too, this is the example and basically I structured my project like this, so it is clean and easy to understand for who will work after me in the future (in case). It takes less time to understand the whole project.

Ideally, inside Presentation folder, I stored all the view files, there are collection of screens, one scene represents one view or one screen.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?