Triangle-Architecture
Got idea from Android Clean Architecture, this is a very simple Android app which describes how we can design a clean and clear architecture for an Android App. This example is using:
- Dagger 2 for dependency injection
- Retrofit and OkHttp for http requests
- DBFlow for saving objects to database
- Robolectric for unit testing
- RxJava and RxAndroid for simplify the business logic
- MultiStateView for changing view state
- Fresco for image loader
Concept
Data
By using repository pattern, data is a module which contains implementation everything relates to data, for example: database, api call, or from a third party service.
Domain
Domain defines interfaces of DataService, DataModel and uses them to build UseCases which contain the app business logic.
Presentation
By using MVVM with Data Binding, Presentation layer uses Domain UseCases to present the business logic on view.
Discussions
Welcome everyone to discuss about this architecture [here] ( https://github.com/longbkiter07/Triangle-Architecture/issues).
Thanks
A big thanks to Android-10 for the Android Clean Architecture. Thanks to Lam for Presentation layer implematation.
License
Copyright(c) 2016 "Si Long <[email protected]>" Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.