SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)M Ahsan Khan
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentationBojan Golubović
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectJadson Santos
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
Web application framework
Web application frameworkWeb application framework
Web application frameworkPankaj Chand
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkMohit Kanwar
 

Was ist angesagt? (20)

Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Java Spring
Java SpringJava Spring
Java Spring
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Angular
AngularAngular
Angular
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring boot
Spring bootSpring boot
Spring boot
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Web application framework
Web application frameworkWeb application framework
Web application framework
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 

Andere mochten auch

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
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
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
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 

Andere mochten auch (20)

Web api
Web apiWeb api
Web api
 
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
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
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
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
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
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
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
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 

Kürzlich hochgeladen (20)

2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
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...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
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
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 

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