You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,12 @@ MVVM involves a data binding approach to make code short and reduce view handlin
31
31
## Choice of correct architect
32
32
:eyes:
33
33
<br>
34
-
**Choice of a correct architecture** for the project involves the understanding of the modules which needs to be developed. Some functionalities works great on MVC, some with Mvp and some with Mvvm. It is quite difficult to debug projects made on MVVM due to data binding and live datas. An application which recieves continous data from a source, needs a regular UI - update and has majorly(80-90%) one sided communicationlike solar-cell, inverters, or any device's status monitoring can work well with MVVM due to **live data** - UI update. Debuging can be easy in such applications as **major flow of data is one sided**.
34
+
**Choice of a correct architecture** for the project involves the understanding of the modules which needs to be developed. Some functionalities works great on MVC, some with Mvp and some with Mvvm. It is quite difficult to debug projects made on MVVM which doesn't have one sided data flow due to data binding and live data. If an application receives continuous data from a source, needs a regular UI update and has majorly(80–90%) one sided communication(eg: sending logs from electronic devices to android app) like solar-cell, inverters, or any device's status monitoring can work well with MVVM due to **live data** - UI update. Debugging these MVVM applications can be easy as **major flow of data is one sided**.
35
35
36
-
MVP is a good approach in writing android projects when we are concerned about testing the bussiness logic w.r.t unit testing via JAVA test frameworks(Not Android frameworks). Since **JAVA test framework** will only resolve java dependencies and a clean presenter layer is free from android related dependencies like context, sharedpreferences, or any other **com.android.*** package. Drawback of MVP is that it ends up writting **20-25% 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.
36
+
MVP is a good approach for writing android projects when we are concerned about testing the bussiness logic w.r.t unit testing via JAVA test frameworks(Not Android). Since **JAVA test framework** will only resolve java dependencies and a clean presenter layer is free from android related dependencies like context, sharedpreferences, or any other **com.android.*** package. Drawback of MVP is that it ends up writting **20-25% extra code** with the same functionality written in MVC or MVVM. Mvp is good if you are really interested in test cases and unit testing of modules.
37
+
For MVP using java test kits just make instance of presenter and run test functions.
38
+
<br> <br>
39
+
eg: **new Presenter().testSomeFunction()**.
37
40
38
41
Mvc is widely used technique in android. Google itself wrote it's repositories in MVC for many years. Now a days google is following MVVM for it's github repositories as these repo's are small and majorly samples. MVC application can be tested via android test frameworks not with JAVA specific test tools due to lack of dependencies of **com.android.*****packages** in java specific tool.
39
42
@@ -42,6 +45,8 @@ Mvc is widely used technique in android. Google itself wrote it's repositories i
42
45
2. A luminous inverter monitoring application can work best with MVVM due to major one sided data flow.
43
46
3. E-commerce application can be build in MVC, MVP but MVVM may make some modules very complex.
44
47
48
+
**NOTE**: There is no single architecture which is best of all. If there was one, there wouldn't be any need of learning other architectures. Choice of correct architecture depends on several factors like initial requirements, data flow, scalability, maintenance, updates(CRs), testing requirements.
49
+
45
50
Except these three android architectures, there is one more architecture named as **"MVI** - Model view Intent". This is not very popular among Android developers. Please check this link if you are interested in **MVI**.
0 commit comments