Android architecture is a software stack of components to support mobile device needs. Android software stack contains a Linux Kernel, a collection of c/c++ libraries which are exposed through application framework services, runtime, and application.
People follow these patterns for great productivity.
1. MVVM (Model View View Model):
Model–View–ViewModel is a software architectural pattern that facilitates the separation of the development of the graphical user interface. It provides data to UI and ViewModel to interact with the model and this is a good way to do code.
ADVANTAGES:
- Easy to Understand.
- Good Productivity.
- Easy to Manage code.
DISADVANTAGES:
- It has a somewhat steep learning curve. How all the layers work together may take some time to understand.
- It adds a lot of extra classes, so it’s not ideal for low-complexity projects.
Using MVVM in Flutter
Flutter is declarative in nature. This means that Flutter builds UI by overriding your build methods to reflect the current state of your app:
the data you need to rebuild your UI at any point in time.
A state can be contained in a single widget, known as a local state. Flutter provides inbuilt classes and methods to deal with self-contained states like StatefulWidget and setState.
Naming Convention:
2. MVP (Model View Presenter):
Model–View–Presenter is a derivation of the model–view–controller architectural pattern, and is used mostly for building user interfaces. In MVP, the presenter assumes the functionality of the “middle-man”. In MVP, all presentation logic is pushed to the presenter
ADVANTAGES:
- No Conceptual Relationship.
- Easy code Maintenance.
- Easy testing.
3. MVI (Model View Intent):
Model-View-Intent (MVI) is reactive, functional, and follows the core idea in MVC. It is reactive because Intent observes the User, Model observes the Intent, View observes the Model, and the User observes the View. Intent pass data to model and model pass data to view and view show data to us.
ADVANTAGES:
- Easy to debug.
- Easy to understand data flow.
4. MVC (Model View Controller):
Model–view–controller is a software architectural pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements. This is done to separate internal representations of information from the ways information is presented to and accepted by the user. MVC is as same as MVP and this pattern has a controller instead of a presenter.
ADVANTAGES:
- Unity Testing.
- Model Controller.
Top comments (0)