Jess Chadwick Website Manager, Infragistics

Slides:



Advertisements
Similar presentations
Svetlin Nakov Director Training and Consulting Activities National Academy for Software Development (NASD) ASP.NET 3.5 New Features.
Advertisements

.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Introduction to ASP.NET MVC
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
ASP.NET MVC Best Practices Simone Chiaretta Solution Developer, Avanade 21 Ottobre 2009.
Fabian Vilers Hands on ASP.NET MVC.
ASP MVC s/mvc-4/getting-started-with- aspnet-mvc4/intro-to-aspnet- mvc-4.
What’s new in ASP.NET 3.5? Mike Ormond Developer & Platform Group Microsoft Ltd
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.
Virtual techdays INDIA │ November 2010 ASP.Net MVC Deep Dive Sundararajan S │ Associate Tech Architect, Aditi Technologies.
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.
ASP.NET 4.0 Web Developers User Group Israel June 2009.
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,
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Jess Chadwick Lead Code Monkey Infragistics Website Team Todd Snyder Development Team Lead Infragistics Experience Design Group.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Introduction to ASP.NET MVC Blogging Engine in 60 minutes Adnan Masood
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
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.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
MVC A new Web Project Type for ASP.NET. An option. More control over your More control over your A more easily Testable Framework. Not for everyone.
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Noam King CTO Sela College
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.
ASP.NET MVC in Action Austin Code Camp, 2009 Jeffrey Palermo Chief Technology Officer Headspring Systems.
2 ASP.NET MVC Scott Hanselman Senior Program Manager Microsoft.
Getting started with ASP.NET MVC Dhananjay
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
ASP.Net MVC Extensibility, scalability and testability Andrew Locatelli Woodcock.
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.
Virtual techdays INDIA │ 9 th – 11 th January 2011 ASP.Net MVC Sundararajan S │ Associate Tech Architect, Aditi Technologies.
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Scott Guthrie
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
Model-View-Controller an introduction to MVC design pattern with Castle.MonoRail Presentation: v1.0 Prepared by: Chorn Sokun
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
Understanding Dependency Injection… and those pesky containers Miguel A. Castro Architect -
Bob German Principal Architect Developing SharePoint Applications with MVC and Entity Framework.
//liveVirtualacademy2011/ What’s New for ASP.NET 4.5 and Web Development in Visual Studio 11 Developer Preview Γιώργος Καπνιάς MVP, MCT, MCDP, MCDBA, MCTS,
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Introduction to ASP.NET MVC [Name] [ Address] [Blog URL]
Introducing the Microsoft® .NET Framework
Build and Learn ASP.NET Workshop.
Introduction to ASP.NET MVC
Social Media And Global Computing Introduction to The MVC Pattern
ASP.NET MVC Introduction
Haritha Dasari Josue Balandrano Coronel -
ASP.NET 3.5 Mike Ormond Developer & Platform Group Microsoft Ltd
CO6025 Advanced Programming
ASP.NET Web Forms Vs. ASP.NET MVC ASP.NET is Microsoft’s big leap after Active Server Pages (ASP), ASP.NET provides flexible and unified web development.
Introduction to ASP.NET MVC
ASP.NEXT The ASP.NET 3.5 Extensions
From Development to Production: Optimizing for Continuous Delivery
From Development to Production: Optimizing for Continuous Delivery
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
Introduction to ASP.NET Parts 1 & 2
Concepts in ASP.NET Core App
Presentation transcript:

Jess Chadwick Website Manager, Infragistics

The Genealogy of Awesomeness History of Microsoft Web Stuff

Active Server Pages

Active Server Pages (ASP)  V1 circa 1996  “Active Scripting Pages”: top-down script  Call into VB6/COM code to do “real work”  You might remember these oldies but goodies:  Request object  Response object  Session object  Server object  Application object  ObjectContext object  ASPError object

Classic ASP Example

ASP.NET  Released in 2002 as part of.NET 1.0  Not “ASP v.Next” – completely new  Introduced a few important concepts:  Rich programming framework  Code-Behind  Page Lifecycle  The omnipresent ViewState !

ASP.NET Page Lifecycle

“ASP.NET Extensions”  Started with “ASP.NET Futures”  ASP.NET AJAX  Silverlight Controls  ADO.NET Data Services  ASP.NET Dynamic Data And…  ASP.NET MVC!

What is ASP.NET MVC?  Microsoft’s ASP.NET implementation of the MVC software pattern  More control over your HTML and URLs  More easily testable framework  A new Web Project type for ASP.NET  An option / alternative

Let’s whet the appetite! DEMO: MVC Hello World

What’s the Point?  This is not “Web Forms v.Next”  All about alternatives  Flexibility  Extend it… or not  Create your own Controller- and ViewEngines, or use others such as Brail or NHaml  Fundamental  Part of System.Web namespace  Fully supported  KISS & DRY

Driving Goals  Separation of Concerns  Easy testing & TDD  Highly-maintainable applications  Extensible and Pluggable  Plug in what you need  Build your own custom build

Driving Goals (cont’d)  Clean URLs and HTML  SEO and REST friendly  Great interaction with ASP.NET  Handlers, Modules, Providers, etc. still work .ASPX,.ASCX,.MASTER pages  Visual Studio ASP.NET Designer surface

Careful – there’s a grease spot over there… Take a Look Under the Hood

Request Flow Request HTTP Routing Route Route Handler Http Handler Controller View Engine View Response

The Pattern ModelController View

The Model “The center of the universe” - Todd Snyder  This represents your core business domain… AKA – your “bread and butter”  Preferably independent of any specific technology

Views  Are for rendering/output.  Are usually pretty “stupid”  Web Forms as default ViewEngine .ASPX,.ASCX,.MASTER, etc.  Html Helpers for rendering markup  Can replace with other view technologies:  Template engines (NVelocity, Brail, …).  Output formats (images, RSS, JSON, …).  Mock out for testing.  Can use loosely typed or strongly typed data

Controllers  URLs route to actions on controllers, not pages  Controller executes logic, loads data (if any), and chooses view.  Can also redirect to other views & URLs public ActionResult ShowPost(int id) { Post p = PostRepository.GetPostById(id); if (p == null) { return RenderView("nosuchpost", id); } else { return RenderView(“showpost", p); }

Request Flow Request HTTP Routing Route Route Handler Http Handler Controller View Engine View Response

ModelController View The MVC Pattern in action Browser makes a request Route is determined Controller is activated Method on Controller is invoked Controller does some stuff Renders View, passing in custom ViewData URLs are rendered, pointing to other Controllers

DEMO: Northwind Sample

Routing Filters Extensibility View Engines Controller Factories Routing Handler ASP.NET MVC Features

URL Routing  Developers add Routes to a global RouteTable  Mapping creates a RouteData - a bag of key/values RouteTable.Routes.Add( new Route("blog/bydate/{year}/{month}/{day}", new MvcRouteHandler()){ Defaults = new RouteValueDictionary { {"controller", "blog"}, {"action", "show"} }, Constraints = new RouteValueDictionary { })

“Can’t you just stop and ask for directions!?” Demo: URL Routing

URL Routing (cont’d)  Separate assembly, not closely tied/related to ASP.NET MVC

Filters  Add pre- and post-execute behaviors to your controller actions  Useful for logging, compression, etc. public abstract class ActionFilterAttribute { public void OnActionExecuting(ActionExecutingContext context) ; public void OnActionExecuted(ActionExecutingContext context) ; // New in Pre-Preview 3: public void OnResultExecuting(ResultExecutingContext context); public void OnResultExecuted(ResultExecutedContext context); }

Extensibility  Views  Controllers  Models  Routes …all Pluggable

ViewEngineBase  View Engines render output  You get WebForms by default  Can implement your own  MVCContrib has ones for Brail, Nvelocity  NHaml is an interesting one to watch  View Engines can be used to  Offer new DSLs to make HTML easier  Generate totally different mime/types  Images, RSS, JSON, XML, OFX, VCards, whatever.

ViewEngineBase Class public abstract class ViewEngineBase { public abstract void RenderView(ViewContext viewContext); }

Example View: Web Forms Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %> CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %> ( ) ( ) </asp:Content>

Example View: NHaml %h2= ViewData.CategoryName %ul - foreach (var product in ViewData.Products) %li = product.ProductName.editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" }) - foreach (var product in ViewData.Products) %li = product.ProductName.editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" })

Now we can really take control! Demo: Filters and View Engines

MVCContrib  Myriad UI helper extensions and classes  View Engines  NHaml  NVelocity  Brail  Xslt  Controller factories (for IoC)  Castle (Windsor)  Spring.NET  Ninject  StructureMap  Object Builder  Unity Open Source project with extensions to base framework On CodePlex at

“What!? I can mock out HttpContext!?” Testability

Designed for Testability  Mockable Intrinsics  HttpContextBase, HttpResponseBase, HttpRequestBase  Extensibility  IController  IControllerFactory  IRouteHandler  ViewEngineBase

Testing Controller Actions  No requirement to test within ASP.NET runtime!  Use RhinoMocks, TypeMock, Moq, etc.  Create Test versions of the parts of the runtime you want to stub [TestMethod] public void ShowPostsDisplayPostView() { TestPostRepository repository = new TestPostRepository(); TestViewEngine viewEngine = new TestViewEngine(); BlogController controller = new BlogController(…); controller.ShowPost(2); Assert.AreEqual("showpost",viewEngine.LastRequestedView); Assert.IsTrue(repository.GetPostByIdWasCalled); Assert.AreEqual(2, repository.LastRequestedPostId); } [TestMethod] public void ShowPostsDisplayPostView() { TestPostRepository repository = new TestPostRepository(); TestViewEngine viewEngine = new TestViewEngine(); BlogController controller = new BlogController(…); controller.ShowPost(2); Assert.AreEqual("showpost",viewEngine.LastRequestedView); Assert.IsTrue(repository.GetPostByIdWasCalled); Assert.AreEqual(2, repository.LastRequestedPostId); }

“Wasn’t this supposed to come first?” DEMO: Test-Driven Development

(I know what you’re thinking…) Popular Questions

Why reinvent the wheel?  Aren’t there already existing frameworks out there, such as Monorail?

ASP.NET MVC & REST  Does MVC do REST?  Depends on your definition.  What about ADO.NET Data Extensions (Astoria) and/or WCF?

Controls & Components  Can still use server controls?  Can we still use Web Forms server controls?  Decent support for user controls  Still more/better support to come

What about AJAX?  ASP.NET AJAX?  Requires  Roll your own  JS frameworks like jQuery make this easier

Scalability, Performance, Security, Etc.  A layer of abstraction working over the solid, tested ASP.NET foundation

When’s It Gonna Be Ready?

What’s the Point?  This is not “Web Forms v.Next”  All about alternatives  Flexibility  Extend it… or not  Create your own Controller- and ViewEngines, or use others such as Brail or NHaml  Fundamental  Part of System.Web namespace  Fully supported  KISS & DRY

Q & A (…and Thank You!)

Resources  The Bits  ASP.NET MVC Preview 2:  ASP.NET MVC Pre-Preview3:  MVCContrib:  Quickstart   Videos  ASP.NET:  MIX:  Community/Blogs  ASP.NET Forums:  Scott Guthrie (ScottGu):  Scott Hanselman:  Phil Haack:  Sample Apps  MVC Samples:  CodeCampServer: Jess Chadwick Web Lead Infragistics, Inc.