Coder Social home page Coder Social logo

news's Introduction

News

News is a project that hopes to demonstrate a good architecture when writing MVVM apps.

Architecture

Assembly:

Assemblies are responsible for assembling application features, that is, creating object graphs.

The rule to follow in order to correctly use these assemblies is to never inject assemblies directly to other objects in the application. Objects can not be directly related to assemblies. In the case of navigators we might be tempted to inject an assembly to instantiate the new scene to navigate. As we said before, the objects can not have direct relation to the assemblies, so a solution to this problem would be to create a provider that provide us with the instance of a scene. In the News app, the provider of the detail scene is the assembly.

So you may be wondering, what are the advantages between this dependency container and Swinject? The differences with Swinject are minimal. We have all the advantages of a dependency container like Swinject except thread safety. In addition we have total control of the assemblies, and we do not have dependencies in third-party libraries.

Navigator:

Navigators are responsible for navigating to a scene. They need the providers in order to provide the instances of the scenes. If the providers did not exist and, considering that we can't inject assemblies directly to the objects of the application, we would be attaching the navigator with the dependencies of the scenes. Keep in mind that the navigator could be used in more than one scene.

Credits

The project architecture is inspired by the MVP architecture seen in the Architecture Course given by Guillermo.

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.