I'm new to android application design architectures. I read so many materials and watched so many videos. I think i understand the mvp concept. mvp is used in presentation layer. but there are two other layers exists too: domain layer and data layer. And it is said that all the business logic done in the domain layer in other words interactors. However in some other resources, it is said that all the business logic done in the presenter. Where does business logic done?

Source code examples in the web are either simple like building a toy house or very complex including 100+ classes interfaces dagger rxjava and other 100+ frameworks tools so so many things like building skyscraper. I already read the all available articles on the web. Please do not give these links. Please help me by explaining to understand mvp concept with data domain presentation layer concepts?

1 Answers

0
notTdar On

I just wrote informally this for MVP -clean, a sample is to get a list

presentation:

  • view

    : (init LocalDataSource and DataManager and Executors/other for async)
    : Pass the Executors/other and DataManager ref to presenter (concrete class, preferable PresenterImp or whatever)

    • presenter

    : Pass the Executors/other and DataManager ref to model (concrete class, preferable ModelImp or whatever)

domain :

  • executors
  • entity
  • model (mvp - model)

    : this also act as interactor/use cases here , now through that executors ref you request from DataManager's puclic method to get data

    eg: mExecutor.submit(new Runnable(){

      mDataManager.getMeBadGOTwriterList(new ACallback(){
    
      onSuccess(List BadWriter){
    
      mPrenter.sendList(BadWriter);
      }
    
      onFailed(){
      }
      }
    

    }

data :

: DataManager (Central Repository)

   - has DataSource as member


   //getABadWriterList
   public  void getMeBadGOTwriterList(DataSource.ACallback callaback){

   mDataSource.getMeList(callback)l

   }

: DataSource (interface)

  • LocalDataSource (implements DataSource)
  • RemoteDataSource (implements DataSource)