Code Monkey home page Code Monkey logo

dog-breeds's Introduction

Dog Breeds


๐Ÿ› ๏ธ Built With


๐Ÿ“ Module Architecture

This project is based on concepts of Clean Architecture, and the layers were divided as below:

Presentation Chart

๐Ÿ“– Domain Layer

The most INNER part of the circle, it contains Entities, Use cases, Services Interfaces and Repositories Interfaces.

  • Entity: A data class that represents a Business Model and all its attributes Ex: (A Group, User or Message)
  • Use Case: Defines the application behavior; It is responsible for executing every application rule and return data, throw errors, all the application logic resides in use cases; A use case have an Input and/or Output data class.
    1. Use Case Interface: Protocol mainly used for Mocking Test behavior.
    2. Use Case Implementation: Implementation itself of all the logic.
  • Services protocols: Protocols that defines the behavior of an API service.
  • Repository protocols: Protocols that defines the behavior of a Database repository.

๐Ÿ“ฆ DataSource Layer

Contains Services and Repository implementations.

  • Services Implementations: Services Implementations implements Services Protocols from Domain Layer, in here that you will implement your HTTP, WebSocket code, etc ...
  • Repository Implementations: Repository Implementations implements Repository Protocols from Domain Layer; In here that you will implement your Room, SharedPreferences, FileManager code, etc...

๐Ÿ”ƒ DataSource Layer depends on Domain Layer.

๐ŸŽจ Presentation Layer

Contains UI of every screen, View, Controllers, ViewModels.
Every screen is structured in MVVM (model, view, and view model).

  • ViewModels: A class that is responsible for call actions that can be made on a screen and holds the view state and receive data from UseCases to format it to present in the View.
  • Model: A data class that represents all possible states that a screen can have Ex: (List, Errors, Loading Status)
  • View: A Fragment view itself, that observe a ViewModel state and calls ViewModel actions.

๐Ÿ”ƒ Presentation Layer depends on Domain.

๐ŸŽจ App Layer

Contains SETUP of the entire app, Injections, Application, Core Activity.


๐Ÿงช Tests

Unit tests

All classes of all layers are testable,

  • Domain layer has Use Cases unit tests that validate its behaviour.
  • Data source layer has Services and Repositories tests that validate mapping, data error, service specific errors, unexpected results...
  • Presentation layer has View Models tests that validates entry data, formatting data, actions calls...

Driven Development

In this assignment the features were driven by tests. (TDD)
With this discipline we can prevent unexpected behaviours and develop faster with shorter cycles.

TODOs and Notes to Shape Games

I started the development testing and trying to predict the possible errors and behaviours, but I didn't have time to finish all the tests. You can see the TODOs in the code and the notes in the README.md file. I had started this assignment on the FetchImageLinks, so in there you can see the tests that I had done. Also in the DataSource layer BreedsHttpService you can see the tests that I had done.

My main focus in this assignment was to show my knowledge in the architecture and the tests, so I didn't have time to finish the UI and the tests. It lacks a lot of improvements in the UI, but I think that the architecture and the tests are the most important things in this assignment.

Thank you for reviewing my code, I hope that you like it. ๐Ÿ˜„

dog-breeds's People

Contributors

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