Git Product home page Git Product logo

bigcommerce's Introduction

This Project is build using MVVM architecture and is categorized into following layers

  1. UI layer
  2. Business layer
  3. Repository layer

UI Layer

All Activities,fragments,adapters or any classes that have an android UI dependency fall under this layer. UI layer is responsible for rendering UI on to the screen. UI layer will listen to data changes from corresponding ViewModel and update the UI.

In our example LandingActivity ParentActivity SearchFragment EventDetailFragment ResultsAdapter comes under UI layer.

Business Layer

Handles all the businesses logic for the application. Businesses layer will request the repository layer for any required data. These view models will not have any android UI dependency hence any Unit Test cases written on these classes can run without an android device/emulator. It acts as link between repository layer and UI layer. It is responsible for getting data from repository layer and providing data required for UI.

In our example ResultsViewModel comes under Businesses Layer.

Repository Layer
Responsible for all data related queries. Repository layer will fetch data from either the Room Database or from the API call.

Advantage of this layered architecture is that each module can be tested independently using the Mocking frameworks.

Overview of external Libraries used.

  1. Espresso for UI testing
  2. Mockito for mocking interfaces during testing.
  3. Hamcrest for assertions during testing.
  4. Room database to save favorite events.
  5. Dagger2 for dependency injection.
  6. okhttp and Retorfit for networking.
  7. Glide to display images.
  8. Stetho for debugging data in databases and shared preferences.
  9. MockWebServer from Square to mock responses from web server.

This project utilizes following Android Architecture Components
Live Data helps updating observers about data changes. LiveData is also used inside RoomDatabase to update UI when data inside database changes.
ViewModel helps storing data in classes which aren’t destroyed when Activity destroyed.
Room helps us focusing on writing functionality without worrying about the boiler plate code to create databases and tables. It is a Object mapping library which provides compile time checks to see if SQL statements to return LiveData observables.
DataBinding helps us injecting data directly to XML files.

bigcommerce's People

Contributors

nagaprakash2020 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.