SlideShare a Scribd company logo
Software Architectural Design Patterns
(MVC, MVP, MVVM)
Dongho, LEE
2
2
What’ Design Pattern?
A design pattern is a general reusable solution
to a commonly occurring problem.
Creational Structural Behavioral
Meaning
determines how an
object is created
Organize objects
organize, manage,
and combine the
behavior of an
object
Range
Class Factory Method Adapter(Class)
Interpreter
Template Method
Object
Abstract Factory
Builder
Prototype
Singleton
Adapter(Object)
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
Command
Iterator
Mediator
Memento
Observer
State
Strategy
Visitor
3
3
What’ Architecture Design Pattern?
- Similar to design pattern, but has a broader scope
View
(Composit
e)
Controller
(Strategy)
Model
(Observer)
< Representative Architecture Pattern : MVC >
4
4
Design Pattern simply explained with sample
Classic
MVC
MVC MVP MVVM
5
5
Classic MVC
MODEL VIEW CONTROLLER
User Event
Update CheckCheck for updates
Is Data update
needed?
Request Data update
Yes
Update Data
UI Change
No
6
6
MVC in Android
MODEL
VIEW
(XML)
CONTROLLER
(Activity, Fragment)
User Event
Update CheckCheck for updates
Is Data update
needed?
Request Data update
YesUpdate Data
UI Change
No
Interact with
Get user event
Notify event
Setup View
7
7
MVC in android
VIEW
activity_main.xml
ListView
EditText
Button
CONTROLLER
MainActivity
findViewById()
addListener
(Button, EditText)
childEventListener(
)
getChatFromServe
r()
Notify Event
Setup View
MODEL
ChatData
FireBase
Interact with
ListAdapter.add()
editText.setText()
8
8
MVP Pattern in Android
VIEW PRESENTER MODEL
Request Data
depending on event
Notify event to Presenter
Get Data
Update Data
Update UI Process business logic
User Event
Notify
Send
data
View Layer doesn’t know Model anymore!!
Ask view to setup itself
9
9
MVP in android
VIEW
activity_main.xml
ListView
EditText
Button
MainActivity
implements
MainView
findViewById();
addListener
(Button, EditText)
updateListView()
initializeInputConsole
()
setListAdapter()
PRESENTER
MainPresenter
MainView<Interface>
Notify Event
Ask view to
setup itself
MODEL
ChatData
FireBase
Interact with
updateListView()
initializeInputConsole()
setListAdapter()
1 : 1
10
1
0
MVVM Pattern in Android
View VIEWMODEL MODEL
Request Data
depending on event
Get Data
Update Data
Update UI Process business logic
User Event
Invoke
Action
Update
Model
State
change
event
Data
Binding
Update View Itself
View Layer
doesn’t know Model
anymore!!
11
1
1
MVVM in android
View
activity_main
(xml)
ListView
EditText
Button
MainActivity
ViewModel
ViewModel
<Interface>
MainViewModel
onSendButtonClicked
(View view)
onTextChanged()
getCurrentTime()
Invoke Action
Bind to data
Model
ChatData
FireBase
Interact with
Data Binding
N : 1
12
1
2
Data Binding Library
Required : Android version 2.1
Android Studio 1.3
Gradle upper 1.5.0-alpha1
LAYOUT (XML)
ACTIVITY
Create Method and Observable
13
1
3
Data Binding Library
LAYOUT (XML)
14
1
4
Data binding Library
DataBindingUtils.setContentView()
Binding Class is automatically generated based on xml, and changed base on Pascal notation
standard.
Activity_main.xml -> ActivityMainBinding.class
15
1
5
Data binding Library
Example using ButterKnife
16
1
6
Data binding Library
Example using DataBinding Library
17
1
7
Data Binding Library
LAYOUT (XML)
18
1
8
Data binding Library
ViewModel
Just use observable to settle value.
Learn more :
https://developer.android.com/topic/libraries/data-binding/index.html
19
1
9
Conclusion
What’s COOLEST architecture in Android?
There is no right answer for that.
It’s depend on case by case.
However, ButterKnife that we use on our app CAN BE REPLACED
with Data Binding Library.

More Related Content

What's hot

Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
University of Technology
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
Prem Sanil
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
AngularJS
AngularJSAngularJS
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
ravindraquicsolv
 
.Net Core
.Net Core.Net Core
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJS
Rafael Casuso Romate
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Mikalai Alimenkou
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Android
intive
 
Android Services
Android ServicesAndroid Services
Android Services
Ahsanul Karim
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
Asma CHERIF
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
Jay Kumarr
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
Iblesoft
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
Marco Mangia Musardo
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
MicroPyramid .
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
Aman Jain
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
frgo
 
MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
Himanshu Dudhat
 

What's hot (20)

Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
AngularJS
AngularJSAngularJS
AngularJS
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
.Net Core
.Net Core.Net Core
.Net Core
 
Reactjs
Reactjs Reactjs
Reactjs
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJS
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Android
 
Android Services
Android ServicesAndroid Services
Android Services
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
 

Similar to Acrhitecture deisign pattern_MVC_MVP_MVVM

MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
Model View Controller ext4
Model View Controller  ext4Model View Controller  ext4
Model View Controller ext4
Pankaj Avhad
 
Design patterns
Design patternsDesign patterns
Design patterns
revamptechnologies
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 
Architecture logicielle #4 : mvc
Architecture logicielle #4 : mvcArchitecture logicielle #4 : mvc
Architecture logicielle #4 : mvc
Jean Michel
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Svetlin Nakov
 
Gof design pattern
Gof design patternGof design pattern
Gof design pattern
naveen kumar
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
JayaPrakash.m
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
Sudhakar Sharma
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
bryafaissal
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
AnkitPangasa1
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Rails
codeinmotion
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
People Strategists
 
Stephen Kennedy Silverlight 3 Deep Dive
Stephen Kennedy Silverlight 3 Deep DiveStephen Kennedy Silverlight 3 Deep Dive
Stephen Kennedy Silverlight 3 Deep Dive
MicrosoftFeed
 
JSF Presentation"2"
JSF Presentation"2"JSF Presentation"2"
JSF Presentation"2"
SiliconExpert Technologies
 
Slide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern ConceptSlide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern Concept
Bayu Wijaya Permana Putra
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
Sudhakar Sharma
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
Jitendra Kumar
 
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, MadridOpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
Dierk König
 

Similar to Acrhitecture deisign pattern_MVC_MVP_MVVM (20)

MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Model View Controller ext4
Model View Controller  ext4Model View Controller  ext4
Model View Controller ext4
 
Design patterns
Design patternsDesign patterns
Design patterns
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
Architecture logicielle #4 : mvc
Architecture logicielle #4 : mvcArchitecture logicielle #4 : mvc
Architecture logicielle #4 : mvc
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Gof design pattern
Gof design patternGof design pattern
Gof design pattern
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Rails
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
Stephen Kennedy Silverlight 3 Deep Dive
Stephen Kennedy Silverlight 3 Deep DiveStephen Kennedy Silverlight 3 Deep Dive
Stephen Kennedy Silverlight 3 Deep Dive
 
JSF Presentation"2"
JSF Presentation"2"JSF Presentation"2"
JSF Presentation"2"
 
Slide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern ConceptSlide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern Concept
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, MadridOpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
 

Recently uploaded

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Semiosis Software Private Limited
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 

Recently uploaded (20)

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 

Acrhitecture deisign pattern_MVC_MVP_MVVM

Editor's Notes

  1. Before looking at what architectural patterns are, Let's look briefly at what design patterns are components of an architectural pattern. A design pattern is a pattern that can be easily used according to the situation by summarizing the structural problems that occur frequently in the process of developing a software. You can see various patterns by referring to the design pattern book of GOF which is the most influential word about design pattern. Architectural patterns are similar to software design pattern but have a broader scope. The architectural patterns address various issues in software engineering, such as computer hardware performance limitations, high availability and minimization of a business risk. Some architectural patterns have been implemented within software frameworks.
  2. In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. Architectural patterns are similar to software design pattern but have a broader scope. If a design pattern is a solution to a problem, the architecture pattern is a solution for the overall architecture of the software. First of all, for example, you can see that the familiar MVC architecture patterns are configured to solve one problem in the software architecture through compound patterns, that is consist of various design patterns. View - Composite - When the controller sends a refresh request to the view, it sends an update request to the top - level view component, which is handled automatically. Controller - Strategy - As the controller corresponds to the behavior of the view, all you have to do is change the controller to make the view behave as you want. Model: Observer Pattern - Whenever the state of a model changes, it sends information to the observer controller and view.
  3. So which architecture pattern is most effective for our app? To answer that question we need to look at each architecture pattern.   We will first look at the structure of the classic MVC model, which is the ancestor of all the architectural patterns. Then, let's look at the sample code to see how the other three patterns are implemented
  4. MODEL The Model is an implementation of the application's domain model that includes a data model along with business and validation logic. Examples of model objects include repositories, business objects, data transfer objects (DTOs) using data base, POJO. The view component displays information to the user. Views get data from the model. The data provided from the model can be displayed in various views, and one controller component is connected to each view.The controller component converts user input, specific events, etc. into service requests. The user interacts with the system only through the controller. While there are advantages to being separated into three layers of model, view and controller,The disadvantage is that models and views need to know each other and therefore are less reusable.
  5. MODEL The Model is an implementation of the application's domain model that includes a data model along with business and validation logic. Examples of model objects include repositories, business objects, data transfer objects (DTOs) using data base, POJO. The view component displays information to the user. Views get data from the model. The data provided from the model can be displayed in various views, and one controller component is connected to each view.The controller component converts user input, specific events, etc. into service requests. The user interacts with the system only through the controller. While there are advantages to being separated into three layers of model, view and controller,The disadvantage is that models and views need to know each other and therefore are less reusable. .
  6. The MVC pattern is implemented as follows: The model has the same role as classic MVC. Within this project, it means FireBase and chatData. The view consists of view objects created in xml. Within this project, it means ListView and EditText. The controller is an activity. View objects communicate with the model through activities. An activity changes its data by interacting with the model layer, finding and connecting to the view, and accessing the view directly with the changed result. As a result, the view and controller will have strong coupling, and it is difficult to test the view separately, or to test the activity itself.
  7. The model component is still unchanged. And in the center there is a presenter instead of a controller. Presenter processes the actual business logic. Unlike controller, it does not directly access the view object and directly modify the view object. Instead, it calls the main view which is a virtual view. Change the data of the view object. In other words, because the main Activity and main Presenter communicate with each other through the MainView interface by manipulating the main view, so that manipulate the views in the Android API even though presenter don’t know the actual view that working with. So eventually if the activity implements the MainView interface, so wecan easily test the presenter logic.
  8. The model component is still unchanged. And in the center there is a presenter instead of a controller. Presenter processes the actual business logic. Unlike controller, it does not directly access the view object and directly modify the view object. Instead, it calls the main view which is a virtual view. Change the data of the view object. In other words, because the main Activity and main Presenter communicate with each other through the MainView interface by manipulating the main view, so that manipulate the views in the Android API even though presenter don’t know the actual view that working with. So eventually if the activity implements the MainView interface, so wecan easily test the presenter logic.
  9. The view model itself acts as a model for the view. MVVM pattern is a pattern that allows a view to change its state by itself when it sees that the view model changes, rather than seeing the model layer and changing its data. Again, the model has not changed. The view does not look at the model, but instead sees the view model change and changes the data on its own. And the view model only performs business logic. Applying this pattern requires binding between view objects and the data model.Android provides a data binding library for data binding.Before we look at the project that implements the pattern, let's see how the Android library does the data binding.
  10. The view model itself acts as a model for the view. MVVM pattern is a pattern that allows a view to change its state by itself when it sees that the view model changes, rather than seeing the model layer and changing its data. Again, the model has not changed. The view does not look at the model, but instead sees the view model change and changes the data on its own. And the view model only performs business logic. Applying this pattern requires binding between view objects and the data model.Android provides a data binding library for data binding.Before we look at the project that implements the pattern, let's see how the Android library does the data binding.
  11. To use the data binding library first, you need Android version 2.1 or later, Grades version 1.5.0 alpha 1 version or later.Just add a data binding element to the build.gradle of your app module. 됩니다.
  12. Let's look at the data binding layout file. The root tag is replaced by layout, followed by the data element and the existing view root element.Below is the text in the text view with the addition of the observer field of the view modelYou can see how to add the method itself.
  13. And in the main activity, we create a data binding object and connect it. The name of the data binding class is automatically generated using the name of xml. And in the last line, complete the binding of the view and view model by setting the view model in the binding class.
  14. And in the main activity, we create a data binding object and connect it. The name of the data binding class is automatically generated using the name of xml. And in the last line, complete the binding of the view and view model by setting the view model in the binding class.
  15. And in the main activity, we create a data binding object and connect it. The name of the data binding class is automatically generated using the name of xml. And in the last line, complete the binding of the view and view model by setting the view model in the binding class.
  16. Let's look at the data binding layout file. The root tag is replaced by layout, followed by the data element and the existing view root element.Below is the text in the text view with the addition of the observer field of the view modelYou can see how to add the method itself.
  17. Next is the view model.In the view model, you create an observable field for the view object to observe. If you set this Observable field, the view you are viewing automatically changes its value. Here's the hint of editText. We did this by creating the view model for our example code, In fact, to use the data-binding library, you can use it in your existing Android activity without creating a view model object.
  18. So what pattern is the best?The latest architectural patterns are not the best for us. Above all, we need to apply our architecture pattern to our current situation. Instead, But using the Android data-binding library will enable us to develop data-binding effectively without changing our app architecture at this time.