SlideShare a Scribd company logo
1 of 28
ASP.NET MVC -
5
http://Sharma-
NareshIT.blogspot.com
Design Patterns
Design patterns are solutions to software
design problems you find again and again in
real-world application development. Patterns
are about reusable designs and interactions of
objects..
The 23 Gang of Four (GoF) patterns are
generally considered the foundation for all other
patterns. They are categorized in three groups:
 Creational,
 Structural, and
 Behavioral
Creational Patterns
Abstract
Factory
Creates an instance of several families of classes
Builder Separates object construction from its representation
Factory
Method
Creates an instance of several derived classes
Prototype A fully initialized instance to be copied or cloned
Singleton A class of which only a single instance can exist
Structural Patterns
Adapter Match interfaces of different classes
Bridge Separates an object’s interface from its implementation
Composite A tree structure of simple and composite objects
Decorator Add responsibilities to objects dynamically
Facade A single class that represents an entire subsystem
Flyweight A fine-grained instance used for efficient sharing
Proxy An object representing another object
Behavioral Patterns
Chain of
Resp.
A way of passing a request between a chain of objects
Command Encapsulate a command request as an object
Interpreter A way to include language elements in a program
Iterator Sequentially access the elements of a collection
Mediator Defines simplified communication between classes
Memento Capture and restore an object's internal state
Observer A way of notifying change to a number of classes
State Alter an object's behavior when its state changes
Strategy Encapsulates an algorithm inside a class
Template
Method
Defer the exact steps of an algorithm to a subclass
Visitor Defines a new operation to a class without change
The Model-View-Controller (MVC) architectural pattern separates an
application into three main components: the model, the view, and the
controller.
The ASP.NET MVC framework provides an alternative to the ASP.NET Web
Forms pattern for creating Web applications.
The MVC Pattern
8
 Model–view–controller (MVC) is a software
architecture pattern
 Originally formulated in the late 1970s by
Trygve Reenskaug as part of the Smalltalk
 Code reusability and separation of concerns
 Originally developed for
desktop, then adapted
for internet applications
Model
9
 Set of classes that describes the data we are
working with as well as the business
 Rules for how the data can be
changed and manipulated
 May contain data validation rules
 Often encapsulate data stored in a database as
well as code used to manipulate the data
 Most likely a Data Access Layer of some kind
 Apart from giving the data objects, it doesn't have
significance in the framework
View
10
 Defines how the application’s user interface
(UI) will be displayed
 May support master views (layouts) and sub-
views (partial views or controls)
 Web: Template to dynamically generate HTML
Controller
11
 The core MVC component
 Process the requests with the help of views and
models
 A set of classes that handles
Communication from the user
Overall application flow
Application-specific logic
 Every controller has one or more "Actions"
MVC Steps
12
 Incoming request routed to Controller
For web: HTTP request
 Controller processes request and creates
presentation Model
Controller also selects appropriate result
(view)
 Model is passed to View
 View transforms Model into appropriate output
format (HTML)
 Response is rendered (HTTP Response)
13
The MVC Pattern for Web
14
MVC Pattern in ASP.NET MVC
ASP.NET MVC Request
15
Request Flow
Request View Controller Model
HTTP
Select
ViewHTML
Routing
Select Controller
MVC Frameworks
17
 CakePHP (PHP)
 CodeIgniter (PHP)
 Spring (Java)
 Perl: Catalyst, Dancer
 Python: Django, Flask, Grok
 Ruby: Ruby on Rails, Camping, Nitro, Sinatra
 JavaScript: AngularJS, JavaScriptMVC, Spine
 ASP.NET MVC (.NET Framework)
ASP.NET Web Forms
 Stable and mature, supported by heaps of
third party controls and tools
 Event driven web development
 Postbacks
 Viewstate
 Less control over the HTML
 Hard to test
 Rapid development
ASP.NET MVC
 Runs on top of ASP.NET
Not a replacement for WebForms
Leverage the benefits of ASP.NET
 Embrace the web
User/SEO friendly URLs, HTML 5, SPA
Adopt REST concepts
 Uses MVC pattern
Conventions and Guidance
Separation of concerns
19
ASP.NET MVC (2)
 Tight control over markup
 Testable
 Loosely coupled and extensible
 Convention over configuration
 Razor view engine
One of the greatest view engines
With intellisense, integrated in Visual Studio
 Reuse of current skills (C#, LINQ, HTML, etc.)
 Application-based (not scripts like PHP)
20
Separation of Concerns
 Each component has one responsibility
SRP – Single Responsibility Principle
DRY – Don’t Repeat Yourself
 More easily testable
TDD – Test-driven development
 Helps with concurrent development
Performing tasks concurrently
 One developer works on views
 Another works on controllers
21
Extensible
 Replace any component of the system
Interface-based architecture
 Almost anything can be replaced or extended
Model binders (request data to CLR objects)
Action/result filters (e.g. OnActionExecuting)
Custom action result types
View engine (Razor, WebForms, NHaml, Spark)
View helpers (HTML, AJAX, URL, etc.)
Custom data providers (ADO.NET), etc.
22
Clean URLs
 REST-like
/products/update
/blog/posts/2013/01/28/mvc-is-cool
 Friendlier to humans
/product.aspx?catId=123 or post.php?id=123
Becomes /products/chocolate/
 Friendlier to web crawlers
Search engine optimization (SEO)
23
The ASP.NET MVC History
24
Date Version
10 December 2007 ASP.NET MVC
13 March 2009 ASP.NET MVC 1.0
16 December 2009 ASP.NET MVC 2 RC
4 February 2010 ASP.NET MVC 2 RC 2
10 March 2010 ASP.NET MVC 2
6 October 2010 ASP.NET MVC 3 Beta
9 November 2010 ASP.NET MVC 3 RC
10 December 2010 ASP.NET MVC 3 RC 2
13 January 2011 ASP.NET MVC 3
20 September 2011
ASP.NET MVC 4 Developer
Preview
15 February 2012 ASP.NET MVC 4 Beta
31 May 2012 ASP.NET MVC 4 RC
15 August 2012 ASP.NET MVC 4
30 May 2013 ASP.NET MVC 4 4.0.30506.0
26 June 2013 ASP.NET MVC 5 Preview
23 August 2013 ASP.NET MVC 5 RC 1
17 October 2013 ASP.NET MVC 5
17 January 2014 ASP.NET MVC 5.1
10 February 2014 ASP.NET MVC 5.1.1
4 April 2014 ASP.NET MVC 5.1.2
22 June 2014 ASP.NET MVC 5.1.3
The Technologies
 Technologies that ASP.NET MVC uses
C# (OOP, Unit Testing, async, etc.)
HTML(5) and CSS
JavaScript (jQuery, KendoUI, etc.)
AJAX, Single-page apps
Databases (MS SQL)
ORM (Entity Framework and LINQ)
Web and HTTP
26
The Tools
 Tools that we need:
IDE: Visual Studio 2012 (Express for Web)
 JustCode and Web Essentals
Framework: .NET Framework 4.5
Web server: IIS 8 (Express)
Data: Microsoft SQL Sever (Express or LocalDB)
 Web Platform Installer 4.0 will install
everything we need for us
microsoft.com/web/downloads/platform.aspx
Install Visual Studio Express 2012 for Web
NuGet package management
 Free, open source package management
 Makes it easy to install and update open
source libraries and tools
 Part of Visual Studio 2012
 Configurable package sources
 Simple as adding a reference
 GUI-based package installer
 Package manager console
28

More Related Content

What's hot

Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net frameworkAshish Verma
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 
Spring Framework
Spring FrameworkSpring Framework
Spring Frameworknomykk
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET CoreAvanade Nederland
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To DotnetSAMIR BHOGAYTA
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxNew features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxMuralidharan Deenathayalan
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationabhishek singh
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 

What's hot (20)

Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Web api
Web apiWeb api
Web api
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net framework
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
.Net Core
.Net Core.Net Core
.Net Core
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxNew features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 

Viewers also liked

Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics PresentationSudhakar Sharma
 
Top 9 c#.net interview questions answers
Top 9 c#.net interview questions answersTop 9 c#.net interview questions answers
Top 9 c#.net interview questions answersJobinterviews
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Ido Flatow
 
Building Next Generation Web Apps and Services using ASP.NET 5
Building Next Generation Web Apps and Services using ASP.NET 5Building Next Generation Web Apps and Services using ASP.NET 5
Building Next Generation Web Apps and Services using ASP.NET 5Shravan Kumar Kasagoni
 
Angular-ifying Your Visualforce Pages
Angular-ifying Your Visualforce PagesAngular-ifying Your Visualforce Pages
Angular-ifying Your Visualforce PagesSalesforce Developers
 
Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Edwin Vijay R
 
Salesforce course-training-material
Salesforce course-training-materialSalesforce course-training-material
Salesforce course-training-materialsfdc232
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalRAdam Mokan
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSSimon Guest
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JSAkshay Mathur
 
How to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETHow to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETOzeki Informatics Ltd.
 
C#, OOP introduction and examples
C#, OOP introduction and examplesC#, OOP introduction and examples
C#, OOP introduction and examplesagni_agbc
 
Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3Matt Raible
 

Viewers also liked (20)

Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
Top 9 c#.net interview questions answers
Top 9 c#.net interview questions answersTop 9 c#.net interview questions answers
Top 9 c#.net interview questions answers
 
ASP.NET Brief History
ASP.NET Brief HistoryASP.NET Brief History
ASP.NET Brief History
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Building Next Generation Web Apps and Services using ASP.NET 5
Building Next Generation Web Apps and Services using ASP.NET 5Building Next Generation Web Apps and Services using ASP.NET 5
Building Next Generation Web Apps and Services using ASP.NET 5
 
Intro to asp.net
Intro to asp.netIntro to asp.net
Intro to asp.net
 
Angular-ifying Your Visualforce Pages
Angular-ifying Your Visualforce PagesAngular-ifying Your Visualforce Pages
Angular-ifying Your Visualforce Pages
 
Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)
 
Interview questions
Interview questionsInterview questions
Interview questions
 
C#.net
C#.netC#.net
C#.net
 
Salesforce course-training-material
Salesforce course-training-materialSalesforce course-training-material
Salesforce course-training-material
 
Angular JS
Angular JSAngular JS
Angular JS
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 
How to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETHow to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NET
 
C#, OOP introduction and examples
C#, OOP introduction and examplesC#, OOP introduction and examples
C#, OOP introduction and examples
 
Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3Refreshing Your UI with HTML5, Bootstrap and CSS3
Refreshing Your UI with HTML5, Bootstrap and CSS3
 

Similar to MVC - Introduction

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
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0Shiju Varghese
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Shiju Varghese
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overviewSergey Seletsky
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCIan Carnaghan
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
ASP.NET MVC - In the Wild
ASP.NET MVC - In the WildASP.NET MVC - In the Wild
ASP.NET MVC - In the WildBrian Boatright
 
Presentation Thesis
Presentation ThesisPresentation Thesis
Presentation ThesisNaim Latifi
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1Gaurav Arora
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Gaurav Arora
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttLanvige Jiang
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 

Similar to MVC - Introduction (20)

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
 
Asp.netmvc handson
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
 
Mvc
MvcMvc
Mvc
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
MVC 4
MVC 4MVC 4
MVC 4
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
ASP.NET MVC - In the Wild
ASP.NET MVC - In the WildASP.NET MVC - In the Wild
ASP.NET MVC - In the Wild
 
Presentation Thesis
Presentation ThesisPresentation Thesis
Presentation Thesis
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Session 1
Session 1Session 1
Session 1
 

Recently uploaded

How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 

Recently uploaded (20)

How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 

MVC - Introduction

  • 2. Design Patterns Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects..
  • 3. The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups:  Creational,  Structural, and  Behavioral
  • 4. Creational Patterns Abstract Factory Creates an instance of several families of classes Builder Separates object construction from its representation Factory Method Creates an instance of several derived classes Prototype A fully initialized instance to be copied or cloned Singleton A class of which only a single instance can exist
  • 5. Structural Patterns Adapter Match interfaces of different classes Bridge Separates an object’s interface from its implementation Composite A tree structure of simple and composite objects Decorator Add responsibilities to objects dynamically Facade A single class that represents an entire subsystem Flyweight A fine-grained instance used for efficient sharing Proxy An object representing another object
  • 6. Behavioral Patterns Chain of Resp. A way of passing a request between a chain of objects Command Encapsulate a command request as an object Interpreter A way to include language elements in a program Iterator Sequentially access the elements of a collection Mediator Defines simplified communication between classes Memento Capture and restore an object's internal state Observer A way of notifying change to a number of classes State Alter an object's behavior when its state changes Strategy Encapsulates an algorithm inside a class Template Method Defer the exact steps of an algorithm to a subclass Visitor Defines a new operation to a class without change
  • 7. The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications.
  • 8. The MVC Pattern 8  Model–view–controller (MVC) is a software architecture pattern  Originally formulated in the late 1970s by Trygve Reenskaug as part of the Smalltalk  Code reusability and separation of concerns  Originally developed for desktop, then adapted for internet applications
  • 9. Model 9  Set of classes that describes the data we are working with as well as the business  Rules for how the data can be changed and manipulated  May contain data validation rules  Often encapsulate data stored in a database as well as code used to manipulate the data  Most likely a Data Access Layer of some kind  Apart from giving the data objects, it doesn't have significance in the framework
  • 10. View 10  Defines how the application’s user interface (UI) will be displayed  May support master views (layouts) and sub- views (partial views or controls)  Web: Template to dynamically generate HTML
  • 11. Controller 11  The core MVC component  Process the requests with the help of views and models  A set of classes that handles Communication from the user Overall application flow Application-specific logic  Every controller has one or more "Actions"
  • 12. MVC Steps 12  Incoming request routed to Controller For web: HTTP request  Controller processes request and creates presentation Model Controller also selects appropriate result (view)  Model is passed to View  View transforms Model into appropriate output format (HTML)  Response is rendered (HTTP Response)
  • 14. 14 MVC Pattern in ASP.NET MVC
  • 16. Request Flow Request View Controller Model HTTP Select ViewHTML Routing Select Controller
  • 17. MVC Frameworks 17  CakePHP (PHP)  CodeIgniter (PHP)  Spring (Java)  Perl: Catalyst, Dancer  Python: Django, Flask, Grok  Ruby: Ruby on Rails, Camping, Nitro, Sinatra  JavaScript: AngularJS, JavaScriptMVC, Spine  ASP.NET MVC (.NET Framework)
  • 18. ASP.NET Web Forms  Stable and mature, supported by heaps of third party controls and tools  Event driven web development  Postbacks  Viewstate  Less control over the HTML  Hard to test  Rapid development
  • 19. ASP.NET MVC  Runs on top of ASP.NET Not a replacement for WebForms Leverage the benefits of ASP.NET  Embrace the web User/SEO friendly URLs, HTML 5, SPA Adopt REST concepts  Uses MVC pattern Conventions and Guidance Separation of concerns 19
  • 20. ASP.NET MVC (2)  Tight control over markup  Testable  Loosely coupled and extensible  Convention over configuration  Razor view engine One of the greatest view engines With intellisense, integrated in Visual Studio  Reuse of current skills (C#, LINQ, HTML, etc.)  Application-based (not scripts like PHP) 20
  • 21. Separation of Concerns  Each component has one responsibility SRP – Single Responsibility Principle DRY – Don’t Repeat Yourself  More easily testable TDD – Test-driven development  Helps with concurrent development Performing tasks concurrently  One developer works on views  Another works on controllers 21
  • 22. Extensible  Replace any component of the system Interface-based architecture  Almost anything can be replaced or extended Model binders (request data to CLR objects) Action/result filters (e.g. OnActionExecuting) Custom action result types View engine (Razor, WebForms, NHaml, Spark) View helpers (HTML, AJAX, URL, etc.) Custom data providers (ADO.NET), etc. 22
  • 23. Clean URLs  REST-like /products/update /blog/posts/2013/01/28/mvc-is-cool  Friendlier to humans /product.aspx?catId=123 or post.php?id=123 Becomes /products/chocolate/  Friendlier to web crawlers Search engine optimization (SEO) 23
  • 24. The ASP.NET MVC History 24
  • 25. Date Version 10 December 2007 ASP.NET MVC 13 March 2009 ASP.NET MVC 1.0 16 December 2009 ASP.NET MVC 2 RC 4 February 2010 ASP.NET MVC 2 RC 2 10 March 2010 ASP.NET MVC 2 6 October 2010 ASP.NET MVC 3 Beta 9 November 2010 ASP.NET MVC 3 RC 10 December 2010 ASP.NET MVC 3 RC 2 13 January 2011 ASP.NET MVC 3 20 September 2011 ASP.NET MVC 4 Developer Preview 15 February 2012 ASP.NET MVC 4 Beta 31 May 2012 ASP.NET MVC 4 RC 15 August 2012 ASP.NET MVC 4 30 May 2013 ASP.NET MVC 4 4.0.30506.0 26 June 2013 ASP.NET MVC 5 Preview 23 August 2013 ASP.NET MVC 5 RC 1 17 October 2013 ASP.NET MVC 5 17 January 2014 ASP.NET MVC 5.1 10 February 2014 ASP.NET MVC 5.1.1 4 April 2014 ASP.NET MVC 5.1.2 22 June 2014 ASP.NET MVC 5.1.3
  • 26. The Technologies  Technologies that ASP.NET MVC uses C# (OOP, Unit Testing, async, etc.) HTML(5) and CSS JavaScript (jQuery, KendoUI, etc.) AJAX, Single-page apps Databases (MS SQL) ORM (Entity Framework and LINQ) Web and HTTP 26
  • 27. The Tools  Tools that we need: IDE: Visual Studio 2012 (Express for Web)  JustCode and Web Essentals Framework: .NET Framework 4.5 Web server: IIS 8 (Express) Data: Microsoft SQL Sever (Express or LocalDB)  Web Platform Installer 4.0 will install everything we need for us microsoft.com/web/downloads/platform.aspx Install Visual Studio Express 2012 for Web
  • 28. NuGet package management  Free, open source package management  Makes it easy to install and update open source libraries and tools  Part of Visual Studio 2012  Configurable package sources  Simple as adding a reference  GUI-based package installer  Package manager console 28