Giter VIP home page Giter VIP logo

githublist's Introduction

GithubList

An example app that utilizes Github users API.

At 4/23, I've refactored the source code to use clean architecture. You can see the old implementation before refactoring here: https://github.com/lutfime/GithubList/tree/633937225f3e5def9ceede6d152f6fcf57058e8e

The commits has been done in smaller scale with description, you can follow the refactoring processes here. https://github.com/lutfime/GithubList/commits/master

Improvements of the implementation using clean architecture:

  • Use of composition root to compose dependencies
  • Use dependency injection for better components testability
  • Use dependency inversion for APILoader and LocalLoader instead of using concrete infrastructure implementation. This makes the components more reusable and testable.
  • Use adapter, decorator and composite patterns to compose different behaviour of LocalLoader, RemoteLoader and ImageLoader
  • Move cross cutting concern such as threading and internet connection check from view model and view controller to composition root.
  • Better separation of code
  • Added more unit tests
  • Added snapshot tests
  • Use observer instead of delegate in view model for better readability
  • Remove anti-pattern singleton usage
  • Now view controller become more clean, only used for displaying UI instead of contains logic.

There are multiple improvements still can be done in the future

  • Add more unit tests that tests each class components to work correctly
  • Add acceptance tests that test the overall behaviour of the app. For example test when offline app load and render data from cache
  • Separate User object to User and UserProfile so each UserList and UserProfile screens use either one only. By separating model objects, we can make the properties immutable which are more type safe.

App Architecture

GithubList App Architecture

Note: Composition root is not shown in the diagram as composition root uses have dependencies to most modules because composition root is a centralized place to compose the dependencies.

Preview

github list

githublist's People

Contributors

lutfime 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.