Giter VIP home page Giter VIP logo

currentrestaurants's Introduction

CurrentRestaurants

Prepared explanation

  • rxjava
  • viewmodel factory and providers
  • Paging source
  • Use of FlatMaps, Observables, and translations through Singles

Screen Shot 2020-12-17 at 4 00 23 PM

Screen Shot 2020-12-17 at 4 00 35 PM

Clean Android Architecture

Clean architecture is the separation of concerns. We want the “inner levels” meaning we start on the inside with the web/domain going through the use cases through the viewmodel to the view (outermost) to have no idea of what is going on in the classes that it calls across circles.

The outer circle represents the concrete mechanisms that are specific to the platform such as networking and database access. Moving inward, each circle is more abstract and higher-level. The center circle is the most abstract and contains business logic, which doesn’t rely on the platform or the framework you’re using.

A unidirectional flow will ensure that because things are decoupled further and modularity remains a focus we will be able to increase the speed at which we add new features. Librification becomes easier as well if we continue to scale the application and parts of our application need to be portable across apps. Between our Use Case and domain we want to use interfaces for two reasons

A Data layer which is of a higher, more abstract level doesn’t depend on a framework, lower-level layer. The repository is an abstraction of Data Access and it does not depend on details. It depends on abstraction.

final-architecture

In order to get an endless list we need to pagination and here are the problems it solves

  • The list grows unbounded in memory, wasting memory as the user scrolls.
  • We have to convert our results from Flow to LiveData to cache them, increasing the complexity of our code.
  • If our app needed to show multiple lists, we'd see that there is a lot of boilerplate to write for each list.

Typically, your UI code observes a LiveData object (or, if you're using RxJava2, a Flowable or Observable object), which resides in your app's ViewModel. This observable object forms a connection between the presentation and contents of your app's list data.

In order to create one of these observable PagedList objects, pass in an instance of DataSource.Factory to a LivePagedListBuilder or RxPagedListBuilder object. A DataSource object loads pages for a single PagedList. The factory class creates new instances of PagedList in response to content updates, such as database table invalidations and network refreshes. The Room persistence library can provide DataSource.Factory objects for you, or you can build your own.

currentrestaurants's People

Stargazers

Roman avatar

Watchers

James Cloos avatar Adrian Mohnacs 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.