GithubHelp home page GithubHelp logo

azizhudai / android-firebase-kotlin-java-mvp-mvc-mvvm-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saksham24/android-firebase-kotlin-java-mvp-mvc-mvvm-chat

0.0 1.0 0.0 993 KB

Simple chat Application with one to one connectivity using Firebase Real time Database written in MVC,MVP and MVVM architecture to better understand the android coding patterns. Purpose of writing same application functionality with 3 different pattern is to show how single application can be developed using 3 different patterns(Mvc, Mvp, Mvvm).

Java 65.07% Kotlin 34.93%

android-firebase-kotlin-java-mvp-mvc-mvvm-chat's Introduction

What is this repository for โ“

Simple Application with one to one connectivity using Firebase Real time Database written in MVC,MVP and MVVM architecture to better understand the android coding patterns. Purpose of writing same application functionality with 3 different pattern is to show how single application can be developed using 3 different patterns(Mvc, Mvp, Mvvm) ๐Ÿ˜Œ.








Mvc (Model View Controller) ใ€ฝ๏ธ โœ”๏ธ C

Mvc is a clean approach in android putting views away from the controller. the controller is only responsible for updating models, once the model gets updated it can notify views and then the view can be updated using proper callbacks. Traditional MVC is where there is a

Model : Acts as the model for data
View : Deals with the view to the user which can be the UI
Controller :Controls the interaction between Model and View, where view calls the controller to update the model. A view can call multiple controllers if needed..

Mvp (Model View Presenter) ใ€ฝ๏ธ โœ”๏ธ ๐Ÿ…ฟ๏ธ

Some disadvantages of MVC can be overcome using Mvp approach. Presenter in Mvp contains all business logic and this class is far away from android Context or android related dependencies which provides flexibility to text business logic by simply using presenter class in test modules. Android related dependencies create complexity in testing. The presenter does not have any android dependency like Context, View etc and all the model updates and network requests are done via presenter. Once the model gets updated or a network request completes, the view is updated via presenter using callbacks to view from the presenter. No model and network request can directly approach views.

Mvvm (Model View View-Model) ใ€ฝ๏ธ โœ”๏ธ โœ”๏ธ ใ€ฝ๏ธ

MVVM involves a data binding approach to make code short and reduce view handling code from java classes. View models are responsible to update view and once a view model is tied to a view then view get notified about their updating events. If a model gets updated by a user click then model send callbacks to view model which updates the view automatically as it gets tied to the views. Mvvm reduce code size but the implementation of MVVM is quite tough and it is difficult to debug big projects based on Mvvm.









Choice of correct architect

๐Ÿ‘€
Choice of a correct architect for a project involves the understanding of the modules which will be developed. Some functionalities work great on MVC, some with Mvp and some with Mvvm. It is quite difficult to debug project made using MVVM format so a small project is recommended for MVVM selection. MVP is still the best approach in writing android projects but MVP end up with 20% extra code with the same functionality written in MVC. Mvp is good if you are really interested in test cases and unit testing of modules. Mvc is a widely used technique in android. Google itself write it's repositories in MVC ๐Ÿ‘.




END โš ๏ธ

android-firebase-kotlin-java-mvp-mvc-mvvm-chat's People

Contributors

saksham24 avatar sushant36 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.