Giter Site home page Giter Site logo

imangazalievm / cleanarchitecturemanifest Goto Github PK

View Code? Open in Web Editor NEW
458.0 47.0 41.0 1015 KB

Description of the main principles and rules for building an Android application using Clean Architecture approach

Kotlin 100.00%
android-architecture android android-development mvp-android rxjava-android dagger2-mvp clean-architecture

cleanarchitecturemanifest's Introduction

CleanArchitectureManifest

Clean Architecture Manifest (v. 0.9.5)

Here you will find description of the main principles and rules, that are worth following in developing Android apps using Clean Architecture approach.

Translations:

English | Русский

If you want to translate this document to your language, please visit this page.

Table of contents

Introduction

Clean Architecture is an approach suggested by Robert Martin in 2012.

Clean Architecture includes two main principles:

  1. Separation into layers
  2. Inversion of Control

Let's take a closer look at them.

1. Separating into layers

The main idea of this principle is separating whole app into layers. In general we have three layers:

  1. Presentation layer
  2. Domain layer (business logic)
  3. Data layer

2.Inversion of Control

According to this principle, domain layer must not depends on outer ones. That is, classes from outer layers must not be used in the domain layer. Interaction with outer layers is implemented through interfaces. Declaration of the interfaces contains in domain layer and their implementation contains in outer ones.

Thanks to separation of concerns between classes we can easily change an application code and add new functional with modifying minimal number of classes. In addition we get testable code. Please note that building the right app architecture depends entirely on a developer experience.

Advantages of Clean Architecture:

  • independent of UI, DB or frameworks
  • allows you to add new features faster
  • a higher percentage of test coverage
  • easy packages structure navigation

Disadvantages:

  • large number of classes
  • hard for beginners to understand

Attention: this article assumes knowledge on the following topics:

  • Dagger 2
  • RxJava 2

P. S. I developed an application to demonstrate the use of Clean Architecture in practice. You can find the source code here - Bubbble.

Find this article useful? ❤️

  • Support it by clicking the ⭐️ button on the upper right of this page. ✌️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.