ihorvitruk / buddysearch

Android Clean Architecture example using MVP, Rx: RxJava, RxAndroid, Dagger 2, Data Binding, Retrolambda, Firebase Database, Firebase Auth, Firebase Messaging (FCM), Realm
Apache License 2.0
208 stars 45 forks source link

Data specific model used in presenter #14

Open rafipanoyan opened 6 years ago

rafipanoyan commented 6 years ago

You shouldn't use any data layer specific model in Presenters.

LoginPresenter uses GoogleSignInAccount objects, which is specific to the Login SDK you chose, but this dependencie should not be visible inside the presenter. This violate the Clean Architecture boudaries.

If you study Uncle Bob's clean architecture layers, you can see that the Presenters are one level below the data layer, so the models can't be shared between them if it's a data layer's model.