Android architecture core using Clean Architecture and MVVM as presenter architecture Clean Architecture is used to achieve separation of concerns by dividing the software to layers and that's exactly what we are going to do here : I have divided Core to 3 Layers
- Domain layer (Business Rules)
- Data layer
- Presenter Layer (MVVM)
Domain layer is the business rules layer. it the baseline of your application . it's abstracted layers contains interfaces for all of your business logic which will be implemented in the upper layers such as Data
data class GuestEntity(@SerializedName("success") val isSuccess: Boolean,
@SerializedName("guest_session_id") val guestSessionId: String,
@SerializedName("expires_at") val expiredAt: String)
-
Base Interactors It has abstract classes that UseCasesClasses will extend later . Here i have made 3 types (CompletableUseCase , SingleUseCase , FlowableUseCase) They all need observeOnSchedular and subscribeOnSchedular in their constractor
-
BaseData It has interfaces of :
-
Business Logic Package contains two packages :
-- CaseDataStore : interface has all functions in common in caseCacheI and caseRemoteI
-- CaseCacheI : interface has functions that only needed in the cache class e.g: savingDataToCache implements BaseCacheI
-- CaseRemoteI : interface has functions that only needed in the remote class implements BaseCacheI
.....To Be Continued