CLEAN ARCHITECTURE!!… What does that mean? Sounds Interesting though? Ok so we’ll explore some important facts about it, shall we?
I assume you’ve already built apps whether using Flutter, Native, or in any other language. We usually don’t focus on how the data flow is working, writing independent data layers, separation of code, the real use of OOP, testing, features scaling, …etc.
All we want is to finish the app as soon as possible for shipping it out, BUT what if in some cases we’re building a big project that has multiple features, number of developers working on it, needs to be tested, and so on. And if we imagine continuing building the app like we used to do or we just need to change something in the future… it’s definitely gonna be a messy place to work with!
Clean Architecture
Clean architecture is a software design philosophy introduced by Robert C. Martin in 2017, Clean Architecture is a software design pattern that helps developers write better quality code so that in the long-run, maintaining codebase and testing could be easier. The main purpose of Clean Architecture is to allow the business to adapt to changing technology and interfaces. Clean Architecture is the most powerful solution for building clean apps that multiple teams can work on, independent data layers, scalable for adding/removing features, testable, independent frameworks/tools, and can be easily maintained at any time.
Layers of Clean Architecture
Clean Architecture consists of 5 layers which are shown in the following diagram.
Entities
Entities are the set of related business rules that are critical for an application to function. They are entirely independent of each other within the architecture.
Use Cases/ Interactors
Use cases represent the actions a user can perform in the application. They are a description of the way that an automated system should behave.
Interface Adapters / Presenter
Interface adapters provide a bridge between the outside world and the Use cases and Entities. This layer interacts with the repository.
UI
UI/ Presentation layer allows users to interact with the application.
Infrastructure
Infrastructure represents the external agents. This layer is where all the I/O components go: the UI, database, frameworks, and devices.
Advantages of Clean Architecture
- Maintaining Code is easier
- Code becomes more readable
- Testing code is easier
- Increases programmers productivity
- Gives flexibility in Adding & Removing features
- Components are decoupled or independent of each other
- Well structured
Related Posts...
Mobile AppsTechnical SeminarTechnologiesWeb DesignWebsite developmentWhat is New!What's HotWordPress
Dec 5th, 2024
Mobile applications have transformed the way we live, work, and interact with the world around us. From facilitating seamless communication to enhancing shopping experiences and revolutionising healthcare, mobile apps have […]
Read more
Dec 3rd, 2024
The travel industry is witnessing a significant transformation powered by artificial intelligence (AI). By integrating AI into various aspects of travel, companies can deliver seamless, personalised, and efficient services, ultimately […]
Read more
Nov 28th, 2024
The FemTech (Female Technology) industry has emerged as a transformative force, revolutionising women’s health and fitness through technology-driven solutions. With a global market value of $42 billion in 2020, FemTech […]
Read more