SlideShare uma empresa Scribd logo
1 de 20
Студент : Наджа Аль Кузаи
Группа : 1372
(СПбГЭТУ «ЛЭТИ»)
MVC – Model , View , Controller
MVP – Model , View , Presenter
MVVM – Model , View , View Model
1
Software Architecture
Software architecture is a technical blueprint explaining how the
system will be structured
• The system architecture describes:
– How the system will be decomposed into subsystems (modules),
– Responsibilities of each module,
– Interaction between the modules,
– Platforms and technologies used,
• Each module could also implement a certain architectural model / pattern.
2
Multi-Tier Architecture
3
DB
ORM
WCF
ASP
.NET
HTML
The 3-Tier Architecture
• The 3-tier architecture consists of the following
tiers (layers):
– Front-end (client layer)
• Client software – provides the UI of the system
– Middle tier (business layer)
• Server software – provides the core system logic
• Implements the business processes / services
– Back-end (data layer)
• Manages the data of the system (database / cloud)
4
The 3-Tier Architecture Model
5
Business Logic
Desktop
Client
Mobile
Client
Client
Machine
Database
Data Tier
(Back-End)
Middle Tier
(Business Tier)
Client Tier (Front-End)
Typical Layers of the Middle Tier
• The middle tier usually has parts related to the
front-end, business logic and back-end:
6
Presentation Logic
Implements the UI of the application (HTML5, Silverlight, WPF, …)
Business Logic
Implements the core processes / services of the application
Data Access Logic
Implements the data access functionality (usually ORM framework)
MVC (Model-View-Controller)
What is MVC and How It Works?
7
Model-View-Controller (MVC)
• MVC is one of three ASP.NET programming models.
• MVC. Presented by Trygve Reenskaug in 1979
8
Model-View-Controller (MVC)
Model–view–controller (MVC) is a software design pattern
(architectural pattern) for implementing user interfaces . It
divides a software application into three interconnected
parts,
– Separates the business logic from application data and presentation:
• Model
– Keeps the application state (data)
• View
– Displays the data to the user (shows UI) , visible layer
• Controller
– Handles the interaction with the user , manages Views & user interaction
9
MVC- Environment
• .NET
– ASP.NET MVC, MonoRail
• Java
– JavaServer Faces (JSF), Struts, Spring Web MVC, Tapestry,
JBoss Seam, Swing
• PHP
– CakePHP, Symfony, Zend, Joomla, Yii, Mojavi
• Python
– Django, Zope Application Server, TurboGears
• Ruby on Rails
10
MVC
MySQL/ NoSQL/MongoDB
PHP / Rubby / Paython
Linux / Windows Server
HTML, Java Script/ CSS
Browser/firefox/Internet explorer
Client
Contains all storage
11
MVC-Based Frameworks
MODEL:
Adding & receiving items from DB
Processing Data from/to DB
Speaking only with controller
VIEW:
Only this that user sees.
Speaking only with controller
CONTROLLER:
Takes info from user.
Processes info & talks to DB if needed.
Receives info from DB.
Speaks to VIEW to explain presentation.
12
Model-View-Presenter (MVP)
13
MVP (Model-View-Presenter)
• Model-View-Presenter (MVP) is UI design pattern
similar to MVC
– Model
• Keeps application data (state)
– View
• Presentation – displays the UI and handles UI events (keyboard,
mouse, etc.)
– Presenter
• Presentation logic (prepares data taken from the model to be
displayed in certain format)
14
MVVM Model-View-ViewModel
• Model-View-ViewModel (MVVM) is architectural
pattern for modern UI development
Invented by Microsoft for use in WPF and Silverlight
Based on MVC, MVP and Martin Fowler's Presentation
Model pattern
Officially published in the Prism project (Composite
Application Guidance for WPF and Silverlight)
Separates the "view layer" (state and behavior) from the
rest of the application
15
MVVM Structure
• Model
– Keeps the application data / state representation
– E.g. data access layer or ORM framework
• View
– UI elements of the application
– Windows, forms, controls, fields, buttons, etc.
• ViewModel
– Data binder and converter that changes the Model
information into View information
– Exposes commands for binding in the Views.
16
MVVM Structure
MVVM is typically used in XAML applications (WPF,
Silverlight, WP7) and supports unit testing.
17
Comparison
MVC - Model View Controller
• The input is directed at the Controller first.
• Many-to-one relationship between the Controller and the View.
• One-to-one relationship from Controller to View.
• The Controller returns back to the Model, so there is knowledge between the View and the
expected Model being passed into it.
MVP – Model View Presenter
• The input begins with the View, not the Presenter.
• There is a one-to-one relationship between the View and the Presenter.
• The View holds a reference to the Presenter which is aware of the View its associated with.
• The Presenter updates the View based on the requested actions it performs on the Model, but the
View is not Model aware.
MVVM – Model View View Model
• The input begins with the View, not the View Model.
• While the View holds a reference to the View Model, the View Model has no information about the
View.
• One-to-many relationship between multiple Views and one View Model.
• For example, a WPF View and a Silverlight View could share the same View Model.
18
Вопросы
19
Спасибо за внимание
20

Mais conteúdo relacionado

Mais procurados (15)

MVP in Android by Ratanak
MVP in Android by RatanakMVP in Android by Ratanak
MVP in Android by Ratanak
 
Acrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMAcrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVM
 
3tier architecture
3tier architecture3tier architecture
3tier architecture
 
Mule soft at a glance
Mule soft at a glanceMule soft at a glance
Mule soft at a glance
 
Notacion uml
Notacion umlNotacion uml
Notacion uml
 
Adopting MVVM
Adopting MVVMAdopting MVVM
Adopting MVVM
 
Slide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern ConceptSlide Presentation of MVP Pattern Concept
Slide Presentation of MVP Pattern Concept
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
Case Study for CRM Application For Sales Deaprtment
Case Study for CRM  Application For Sales DeaprtmentCase Study for CRM  Application For Sales Deaprtment
Case Study for CRM Application For Sales Deaprtment
 
Uop bsa-411-week-3-individual-design-classes
Uop bsa-411-week-3-individual-design-classesUop bsa-411-week-3-individual-design-classes
Uop bsa-411-week-3-individual-design-classes
 
Why Choose JSF
Why Choose JSFWhy Choose JSF
Why Choose JSF
 
Enterprise beans
Enterprise beansEnterprise beans
Enterprise beans
 
Understanding ASP.NET MVC
Understanding ASP.NET MVCUnderstanding ASP.NET MVC
Understanding ASP.NET MVC
 
MVC
MVCMVC
MVC
 
Systems Archticture
Systems ArchtictureSystems Archticture
Systems Archticture
 

Semelhante a Software Design Patterns

Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fairTech_MX
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9AHM Pervej Kabir
 
Web engineering - MVC
Web engineering - MVCWeb engineering - MVC
Web engineering - MVCNosheen Qamar
 
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
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC StructureDipika Wadhvani
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Jennie Gajjar
 
Interaction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxInteraction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxGodwin Monserate
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMAndrei Popa
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar PresantationAbhishek Yadav
 
Web tier-framework-mvc
Web tier-framework-mvcWeb tier-framework-mvc
Web tier-framework-mvcKashfUlHuda1
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobilenaral
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1stanbridge
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1stanbridge
 

Semelhante a Software Design Patterns (20)

Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
 
J2 ee archi
J2 ee archiJ2 ee archi
J2 ee archi
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
 
Web engineering - MVC
Web engineering - MVCWeb engineering - MVC
Web engineering - MVC
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
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,...
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
 
Ios models
Ios modelsIos models
Ios models
 
Interaction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxInteraction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptx
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVM
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
 
Web tier-framework-mvc
Web tier-framework-mvcWeb tier-framework-mvc
Web tier-framework-mvc
 
Design pattern
Design patternDesign pattern
Design pattern
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
 
Java and XPages
Java and XPagesJava and XPages
Java and XPages
 

Último

How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Seán Kennedy
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGIThomas Poetter
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 

Último (20)

How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 

Software Design Patterns

  • 1. Студент : Наджа Аль Кузаи Группа : 1372 (СПбГЭТУ «ЛЭТИ») MVC – Model , View , Controller MVP – Model , View , Presenter MVVM – Model , View , View Model 1
  • 2. Software Architecture Software architecture is a technical blueprint explaining how the system will be structured • The system architecture describes: – How the system will be decomposed into subsystems (modules), – Responsibilities of each module, – Interaction between the modules, – Platforms and technologies used, • Each module could also implement a certain architectural model / pattern. 2
  • 4. The 3-Tier Architecture • The 3-tier architecture consists of the following tiers (layers): – Front-end (client layer) • Client software – provides the UI of the system – Middle tier (business layer) • Server software – provides the core system logic • Implements the business processes / services – Back-end (data layer) • Manages the data of the system (database / cloud) 4
  • 5. The 3-Tier Architecture Model 5 Business Logic Desktop Client Mobile Client Client Machine Database Data Tier (Back-End) Middle Tier (Business Tier) Client Tier (Front-End)
  • 6. Typical Layers of the Middle Tier • The middle tier usually has parts related to the front-end, business logic and back-end: 6 Presentation Logic Implements the UI of the application (HTML5, Silverlight, WPF, …) Business Logic Implements the core processes / services of the application Data Access Logic Implements the data access functionality (usually ORM framework)
  • 7. MVC (Model-View-Controller) What is MVC and How It Works? 7
  • 8. Model-View-Controller (MVC) • MVC is one of three ASP.NET programming models. • MVC. Presented by Trygve Reenskaug in 1979 8
  • 9. Model-View-Controller (MVC) Model–view–controller (MVC) is a software design pattern (architectural pattern) for implementing user interfaces . It divides a software application into three interconnected parts, – Separates the business logic from application data and presentation: • Model – Keeps the application state (data) • View – Displays the data to the user (shows UI) , visible layer • Controller – Handles the interaction with the user , manages Views & user interaction 9
  • 10. MVC- Environment • .NET – ASP.NET MVC, MonoRail • Java – JavaServer Faces (JSF), Struts, Spring Web MVC, Tapestry, JBoss Seam, Swing • PHP – CakePHP, Symfony, Zend, Joomla, Yii, Mojavi • Python – Django, Zope Application Server, TurboGears • Ruby on Rails 10
  • 11. MVC MySQL/ NoSQL/MongoDB PHP / Rubby / Paython Linux / Windows Server HTML, Java Script/ CSS Browser/firefox/Internet explorer Client Contains all storage 11
  • 12. MVC-Based Frameworks MODEL: Adding & receiving items from DB Processing Data from/to DB Speaking only with controller VIEW: Only this that user sees. Speaking only with controller CONTROLLER: Takes info from user. Processes info & talks to DB if needed. Receives info from DB. Speaks to VIEW to explain presentation. 12
  • 14. MVP (Model-View-Presenter) • Model-View-Presenter (MVP) is UI design pattern similar to MVC – Model • Keeps application data (state) – View • Presentation – displays the UI and handles UI events (keyboard, mouse, etc.) – Presenter • Presentation logic (prepares data taken from the model to be displayed in certain format) 14
  • 15. MVVM Model-View-ViewModel • Model-View-ViewModel (MVVM) is architectural pattern for modern UI development Invented by Microsoft for use in WPF and Silverlight Based on MVC, MVP and Martin Fowler's Presentation Model pattern Officially published in the Prism project (Composite Application Guidance for WPF and Silverlight) Separates the "view layer" (state and behavior) from the rest of the application 15
  • 16. MVVM Structure • Model – Keeps the application data / state representation – E.g. data access layer or ORM framework • View – UI elements of the application – Windows, forms, controls, fields, buttons, etc. • ViewModel – Data binder and converter that changes the Model information into View information – Exposes commands for binding in the Views. 16
  • 17. MVVM Structure MVVM is typically used in XAML applications (WPF, Silverlight, WP7) and supports unit testing. 17
  • 18. Comparison MVC - Model View Controller • The input is directed at the Controller first. • Many-to-one relationship between the Controller and the View. • One-to-one relationship from Controller to View. • The Controller returns back to the Model, so there is knowledge between the View and the expected Model being passed into it. MVP – Model View Presenter • The input begins with the View, not the Presenter. • There is a one-to-one relationship between the View and the Presenter. • The View holds a reference to the Presenter which is aware of the View its associated with. • The Presenter updates the View based on the requested actions it performs on the Model, but the View is not Model aware. MVVM – Model View View Model • The input begins with the View, not the View Model. • While the View holds a reference to the View Model, the View Model has no information about the View. • One-to-many relationship between multiple Views and one View Model. • For example, a WPF View and a Silverlight View could share the same View Model. 18