Skip to content

MVVM + Clean Architecture + Retrofit + Hilt + Coroutines + Room

Notifications You must be signed in to change notification settings

jignesh8992/Crypto-Currency-MVVM

Repository files navigation

Crypto-Currency-MVVM(Model-View-ViewModel)-Clean Architecture

Model — View — ViewModel (MVVM) with Clean Architecture is the industry-recognized software architecture pattern that overcomes all drawbacks of MVP and MVC design patterns. MVVM suggests separating the data presentation logic(Views or UI) from the core business logic part of the application

“The goal of software architecture is to minimize the human resources required to build and maintain the required system”

MVVM Clean Architecture Best Pratice:

  • Avoid references to Views in ViewModels.
  • Instead of pushing data to the UI, let the UI observe changes to it.
  • Distribute responsibilities, add a domain layer if needed.
  • Add a data repository as the single-point entry to your data.
  • Expose information about the state of your data using a wrapper or another LiveData.
  • Consider edge cases, leaks and how long-running operations can affect the instances in your architecture.
  • Don’t put logic in the ViewModel that is critical to saving clean state or related to data. Any call you make from a ViewModel can be the last one.

The app has following packages:

  1. data: It contains all the data accessing and manipulating components.
  2. domain: It contain all the use-cases and bussiness logic.
  3. presentation: View classes along with their corresponding ViewModel.
  4. di: Dependency providing classes using Dagger-hilt.
  5. common: Utility classes.

Screenshot

Contributing

Feel free to contribute code to this project. You can do it by forking the repository via Github and sending pull request with changes.

When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Also be sure that all tests are passing.

Developed By

Jignesh N Patel - jignesh8992@gmail.com

Follow me on Google+ Follow me on LinkedIn Follow me on Facebook Follow me on Facebook

License

Copyright [2022] Jignesh N Patel

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.