Code Monkey home page Code Monkey logo

assessmentapp-main's Introduction

AssessmentApp

Run Requirements

  • IOS 15.0
  • XCode Version 14.3

OVERVIEW

  • AssessmentApp is a simple iOS App built using Clean Architecture and MVVM.

High Level Layers

  • Domain Layer = Entities + Use Cases + Repositories Interfaces.
  • Data Repositories Layer = Repositories Implementations + API (Network) + Persistence DB.
  • Presentation Layer (MVVM) = ViewModels + Views.

Data Flow

    1. View(UI) calls method from ViewModel (Presenter).
    1. ViewModel executes Use Case.
    1. Use Case combines data from User and Repositories.
    1. Each Repository returns data from a Remote Data (Network), Persistent DB Storage Source or In-memory Data (Remote or Cached).
    1. Information flows back to the View(UI) where we display the list of items.

Dependency Direction

  • Presentation Layer -> Domain Layer <- Data Repositories Layer
  • Presentation Layer (MVVM) = ViewModels(Presenters) + Views(UI)
  • Domain Layer = Entities + Use Cases + Repositories Interfaces
  • Data Repositories Layer = Repositories Implementations + API(Network) + Persistence DB
Domain Layer
  • It contains Entities, FetchProductsUseCase which fetches the products data.
  • it contains Data Repositories Interfaces which are needed for Dependency Inversion.
Presentation Layer
  • Containts the MainController with products data that are observed from the MainViewModel.

ViewModel Contains the view controller business logic apstracted with INPUT and OUTPUT Protocol.

  • Note UI cannot have access to business logic or application logic (Business Models and UseCases), only ViewModels can do it. This is the separation of concerns. We cannot pass business models directly to the View (UI). This why we are mapping Business Models into ViewModel inside ViewModel and pass them to the View.

  • Containts Flow Coordinator for presentation logic.

  • Note Flow Coordinator for presentation logic, to reduce View Controllers’ size and responsibility.

Data Layer
  • Contains Repositories Implementaion, It conforms to interfaces defined inside Domain Layer.

  • Note Data Layer conforms to interfaces defined inside Domain Layer in order to achieve (Dependency Inversion).

  • Contains the DTO and mapping objects.

  • Note Data Transfer Objects DTO is used as intermediate object for mapping from JSON response into Domain. Also for mapping data to the persistent storage.

Infrastructure Layer (Network)
  • Service / Networking - contains the Router enum that is responsible for the apis structure.
  • Endpoint - contains the BasAPI singleton class which contains the genaric base api request.
  • Encoding - contains the all the necessarily encoding methods for building the urls.

assessmentapp-main's People

Watchers

Mahmoud Abdelshafi 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.