Awesome Open Source
Awesome Open Source

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 ⚠️

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (30,381) 
android (6,112) 
kotlin (3,392) 
chat (373) 
kotlin-android (323) 
mvvm (318) 
mvp (216) 
mvc (153) 
mvvm-architecture (106) 
firebase-database (63) 
mvp-architecture (60) 
realtime-messaging (25) 

Find Open Source By Browsing 7,000 Topics Across 59 Categories

Advertising 📦 10
All Projects
Application Programming Interfaces 📦 124
Applications 📦 192
Artificial Intelligence 📦 78
Blockchain 📦 73
Build Tools 📦 113
Cloud Computing 📦 80
Code Quality 📦 28
Collaboration 📦 32
Command Line Interface 📦 49
Community 📦 83
Companies 📦 60
Compilers 📦 63
Computer Science 📦 80
Configuration Management 📦 42
Content Management 📦 175
Control Flow 📦 213
Data Formats 📦 78
Data Processing 📦 276
Data Storage 📦 135
Economics 📦 64
Frameworks 📦 215
Games 📦 129
Graphics 📦 110
Hardware 📦 152
Integrated Development Environments 📦 49
Learning Resources 📦 166
Legal 📦 29
Libraries 📦 129
Lists Of Projects 📦 22
Machine Learning 📦 347
Mapping 📦 64
Marketing 📦 15
Mathematics 📦 55
Media 📦 239
Messaging 📦 98
Networking 📦 315
Operating Systems 📦 89
Operations 📦 121
Package Managers 📦 55
Programming Languages 📦 245
Runtime Environments 📦 100
Science 📦 42
Security 📦 396
Social Media 📦 27
Software Architecture 📦 72
Software Development 📦 72
Software Performance 📦 58
Software Quality 📦 133
Text Editors 📦 49
Text Processing 📦 136
User Interface 📦 330
User Interface Components 📦 514
Version Control 📦 30
Virtualization 📦 71
Web Browsers 📦 42
Web Servers 📦 26
Web User Interface 📦 210