Giter VIP home page Giter VIP logo

card-game's Introduction

War of Suits

1. Project structure

I chose the modularize approach in order to achieve more encapsulation, separation of concerns,and depending on the size of the project, it could lead to a more faster building time.
  • App: is the module responsible to generate dagger application component, it is also responsible for housing the main activity, the first access point to the app.

  • Core: this module has all things that are common between the other modules, such as, base classes, drawables, and utility functions.

  • Test: has some utilities functions to facilitate the testing of the flows, and encapsultes the coroutine rules.

  • War of Suits: it is only for a better organization of the project, within it there are modules that we are more interested in.

    • :Public holds the public api and some models. This module will allow us to apply the dependency inversion principle, keeping the abstraction completely separate from its implementation.
    • :Impl is responsible for the implementation of the WarOfSuits interface. Here is where the magic happens :)
    • :Presentation converts the flows that are emitted in the :Impl module into state of its interest.

In a simplified way, below is the dependency graph between the modules:

Bildschirmfoto 2021-06-04 um 05 44 24

Modularization allows us to work on features in isolation - public api, implementation or ui, without touching other modules, and can avoid building a large chunk, providing therefore faster builds.

Some talks that helped me out: https://www.droidcon.com/media-detail?video=380843878 , https://www.youtube.com/watch?v=TWLkswxjSr0&t=916s

Artifact: apk

2. Stacks

- Project written 100% in kotlin
  • I followed a MVVM pattern with state management, where I tried to keep a unidirectional flow between the layers.

  • As a reactive paradigm kotlin flow was used, where the flows are converted into a StateFlow that helps us by not emitting the same state twice in a row. For single shot events, a channel was used.

  • Dependency injecting was made by using Dagger 2.

  • Tests: For testing the units I made a lot of use of interfaces to be able to build fake implementations where it made sense, in order to test state and not just behavior.

3. Screenshots

card-game's People

Contributors

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