Introduction to ASP.NET MVC

Slides:



Advertisements
Similar presentations
SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Advertisements

Introduction to ASP.NET MVC
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Edoclite and Managing Client Engagements What is Edoclite? How is it used at IU? Development Process?
ASP.NET Web Forms vs. MVC Choosing the right one for web development Harish Ranganathan Senior Evangelist Microsoft Corporation.
Fabian Vilers Hands on ASP.NET MVC.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models.
AMS304: Introduction to the ASP.NET Model View Controller (MVC) Framework Scott Hanselman Eilon Lipton Microsoft Microsoft
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
UNIT-V The MVC architecture and Struts Framework.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
2 ASP.NET MVC Scott Hanselman Senior Program Manager Microsoft.
Getting started with ASP.NET MVC Dhananjay
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
ASP.NET MVC Telerik Academy
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Introduction to ASP.NET MVC [Name] [ Address] [Blog URL]
Introduction to MVC Slavomír Moroz. Revision from Previous Lesson o ASP.NET WebForms applications Abstract away HTTP (similar to desktop app development)
Web Technology Solutions
Build and Learn ASP.NET Workshop.
Introduction to .NET Florin Olariu
Integrating Enterprise Applications Into SharePoint® Portal Server
Social Media And Global Computing Introduction to The MVC Pattern
Introduction to ASP.NET 2.0
Module: Software Engineering of Web Applications
Unit testing your metro style apps built using XAML
DotNetNuke® Web Application Framework
ASP.NET MVC Introduction
Taking ASP.NET AJAX to the Next Level
Data Virtualization Tutorial… CORS and CIS
The Modern ASP.NET Tech Stack!
Haritha Dasari Josue Balandrano Coronel -
CO6025 Advanced Programming
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
MVC Framework, in general.
Module: Software Engineering of Web Applications
Web Development Using ASP .NET
ASP.NET Roadmap Mike Ormond Developer & Platform Group Microsoft Ltd
Model-View-Controller Patterns and Frameworks
Tech·Ed North America /28/ :50 AM
Lecture 1: Multi-tier Architecture Overview
JavaServer Faces: The Fundamentals
Web Development Using ASP .NET
Module: Software Engineering of Web Applications
MIX 09 2/28/2019 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
From Development to Production: Optimizing for Continuous Delivery
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
ASP.NET Core Middleware Fundamentals
Presentation transcript:

Introduction to ASP.NET MVC [Name] [Email Address] [Blog URL] Estimated Time: 60 minutes This presentation serves as an introduction to ASP.NET MVC. It covers where it sits at within the ASP.NET ecosystem and what value propositions it offers. It includes demos showing how to create a basic ASP.NET MVC application as well as how to unit test it.

Session Objectives Takeaways What is ASP.NET MVC? What is MVC? Is it deprecating WebForms? What are its value propositions? Is ASP.NET MVC right for you? Can it ease some web development pain you’re currently having? Takeaways Estimated Time: 1 minute The main objectives of this session are to explain what ASP.NET MVC is and how it sits in the overall ASP.NET ecosystem. We’ll take a look at its main value propositions and see what style of development it enables. The key takeaways are to determine whether or not ASP.NET MVC is the right choice for you as a developer, and to figure out whether or not it can ease some pain you’re currently experiencing as a web developer on the .NET stack.

ASP.NET Then… One web application framework to rule them all… ASP.NET Caching Modules Globalization Pages Controls Master Pages Profile Roles Membership Intrinsics Handlers Etc. Estimated Time: 2 minutes For the entire life of ASP.NET it has been seen as a single framework that included both runtime and presentational aspects. This includes core features such as roles and globalization, as well as WebForms features such as master pages and user controls. One web application framework to rule them all…

ASP.NET Now… ASP.NET Dynamic Data ASP.NET WebForms ASP.NET MVC ASP.NET Presentation ASP.NET WebForms ASP.NET MVC Estimated Time: 2 minutes With the release of .NET Framework 3.5 SP1, ASP.NET started being seen as more modular. ASP.NET Core now represents just the runtime aspects of ASP.NET, and ASP.NET WebForms is simply a presentation option that sits on top of that runtime. With this, it becomes possible to introduce other presentation layer implementations on top of ASP.NET, such as the new ASP.NET MVC framework. While many who are beginning to investigate into ASP.NET MVC think that it is the replacement for WebForms, as you can see, it is simply another option for developing web applications using the ASP.NET runtime. ASP.NET Core Runtime

WebForms is great, but options are good… Estimated Time: 1 minute WebForms has been the only option on the ASP.NET stack and provides a mature product that has proven successful for lots of developers. But it does have some weaknesses.

No real role responsibility… Master Page Control Control UI Presentation Logic Business Logic Data Access Control Control Page Control Control Control Control Estimated Time: 2 minutes The level of abstraction that WebForms provides has a lot of benefits to it, but it doesn’t provide any framework-level guidance in terms of what should do what and when. Between your pages, master pages, user controls, server controls, and custom controls, you can end up with a mixture of HTML, data access code, and business logic. There are certainly methodologies/practices that can be employed with WebForms that can remedy that, but it becomes an implementation task of the developer, since the framework doesn’t provide any of that separation/guidance. Who does what? How and when?

Control abstractions can be negative… Estimated Time: 2 minutes The control abstractions that WebForms provides are very powerful in that they neatly contain all of the UI and business logic needed so you can just place them within a page and go. The adverse side of that is that it can end up hiding complexity that you’d rather have control over. A common problem is viewstate [Advance Animation]. It isn’t viewstate’s fault that things like this can happen, but it can be very easy to consume a control that could end up hurting the performance of your application. In addition, many times the markup rendered by server controls aren’t always ideal and there is little control over that without having to redo its rendering completely.

It isn't easy enough to test… Logic UI Estimated Time: 1 minute It is possible to test a WebForms application, but it isn’t easy enough. There isn’t enough prescriptive guidance around how to do it properly, and for many it requires more effort than it is worth. For unit testing to truly become mainstream and approachable, testability has to be a prime concern of the framework being used, such that writing tests against applications written with it is easy.

So how does ASP.NET MVC differ? Estimated Time: 1 minute What is it about ASP.NET MVC that differentiates itself from WebForms? What value propositions does it provide and how does it benefit users? The primary thing is that it embraces the MVC pattern at the architectural level, and is generally just about getting out of the way of the developer, allowing you to have full control over the areas you want/need to.

MVC = Model-View-Controller (Input) View (Presentation) Model (Logic) Estimated Time: 2 minutes MVC is a design pattern that stands for Model-View-Controller. What is strives to do is separate the concerns of an application’s presentation layer by assigning specific roles to the three different components. The Controller is responsible for handling all user input. Once input has been received, the Controller will perform any operations/actions it needs to, which might include interacting with the Model. The Model represents the core concern/logic of the application. Once the Controller retrieves some model data and performs any work with the model/etc it needs to it constructs a presentation model that describes the model in terms the View can understand. The View is the visual representation of the model. It presents the model data to the actual user in a way that is meaningful. In a web application, this would typically be HTML. With these three pieces in place, your presentation layer becomes cleanly separated in such a way that each component can be developed/tested independently. Separation of concerns!

How does MVC look? Controller Request Controller Handles input MGB 2003 How does MVC look? Controller Controller Handles input (HTTP requests) Request View View Visually represents the model Response Estimated Time: 4 minutes So what does MVC look like when implemented over the web? When an HTTP request comes into the application it is mapped to a controller. Remember as we mentioned in the previous slide, in the MVC design pattern, the controller is the piece of the trifecta that handles all user input. In the case of a web application, user input is represented as HTTP requests [Advance Animation]. Once the controller has received input, it performs whatever operations it needs to and then assembles a presentation model [Advance Animation]. The controller then takes the model and passes it off to the view. Remember that the view is simply a visual representation of the model [Advance Animation]. The view then “transforms” the model into whatever format it uses to represent it. In a web application, this would typically be HTML [Advance Animation]. The view then serves the request by responding with its visual representation. © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

File | New Estimated Time: 8 minutes This demo should show the “File | New” experience with an ASP.NET MVC application. This should include creating a new application and showing the project structure. Run the default web application that is provided and explain how its individual pieces work together. Explain how routing comes in to play (i.e. how a request maps to a controller action) and describe the basic conventions that come out of the box.

What are the tenets of ASP.NET MVC? Estimated Time: < 1 minute So now that we’ve seen a simple example of how ASP.NET MVC looks, what are the primary tenets that it represents?

Framework Goals Frictionless Testability MGB 2003 Framework Goals Frictionless Testability Tight control over <markup> Leverage the benefits of ASP.NET Conventions and guidance … Estimated Time: 3 minutes The primary framework goals of ASP.NET MVC are… Frictionless testability – By “frictionless” I mean that when you want to test your code, the framework it was written it doesn’t cause you friction. This is very important if you want to seriously perform long-term unit testing on an application, because if developers were constantly running into points of friction when trying to test, they would eventually abandon it. Tight cover over markup – ASP.NET MVC doesn’t contain any server controls or high-level abstractions that mask their underlying rendering. When you develop an ASP.NET MVC application, you have complete control over the markup. ASP.NET MVC does include some HTML helpers that “hide” away some HTML, but they are at the most basic level of rendering (i.e. just an <input> element). Leverage the benefits of ASP.NET – Because ASP.NET MVC is built on top of the core ASP.NET runtime, you still have plenty of old-friends that can be used (i.e. profiles, membership, roles, caching). All of the same intrinsics you’ve always known are still valid and used heavily. Conventions and guidance – ASP.NET MVC comes with a set of predefined conventions that make the use of it much easier, without the need to for tons of configuration. It also provides framework-level guidance. The idea is that ASP.NET MVC wants to try to lead developers down the pit of success. © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Clean URLs Don’t settle for… /Products.aspx?CategoryID=123 MGB 2003 Clean URLs Don’t settle for… /Products.aspx?CategoryID=123 When you can easily have… /Product/Puppies Or whatever else makes sense… Estimated Time: 2 minutes Since ASP.NET MVC is so tightly integrated with the ASP.NET Routing engine, it is simple to take control over the URLs that your application exposes. As such, you shouldn’t have to settle for poor URLs that are simply based on the organization of your application’s internals. You should design your sitemap to be as intuitive as you want. When you do this, users will be happier, and so will search engines. © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Any of this can be replaced! MGB 2003 Extensibility Action Filters Model Binders Controller Builder Controller Factory Controller Controller Action Invoker View View Engine Action Result Estimated Time: 2 minutes While ASP.NET MVC provides a strong offering of functionality out of the box, there will be developers that don’t like some of its default behavior or conventions. Luckily for them they can easily replace anything in the execution pipeline they don’t care for with their own implementation. Because ASP.NET MVC employs separations of concerns throughout its entire API, every task has specific representation that can easily be tweaked/replaced, without having to affect anything else around it. Any of this can be replaced! © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

MVC Development Estimated Time: 13 minutes This demo is meant to show how to begin developing your own MVC application (beyond File | New). This will include creating a model (EDM?), and then building controllers/views that work against it. Show the tooling support in Visual Studio for scaffolding CRUD functionality. Show how to do read-only and data-modification scenarios, complete with some basic form validation and AJAX functionality.

How about unit testing? Estimated Time: 1 minute Oops, we almost forgot about unit testing. Up to this point we’ve seen how you can develop an ASP.NET MVC application but we haven’t seen how you can go about testing it.

Unit Testing Estimated Time: 10 minutes This demo is meant to show how to write some simple unit tests against the controller(s) written in the previous demo. It should illustrate how to successfully test actions that are for GET and POST scenarios. It should also includes some examples of how to test your route definitions.

Summary ASP.NET MVC is a new application option built on top of ASP.NET WebForms isn’t being deprecated ASP.NET MVC strives to provide strong, frictionless testability It places a lot of the control in your hands Estimated Time: 1 minute In summary, ASP.NET MVC is simply a new web application type that is built on top of the ASP.NET runtime. It is not replacing WebForms but is simply a new option. It you care a lot about testability and control then ASP.NET MVC is most likely for you.