Introduction to ASP.NET MVC Blogging Engine in 60 minutes Adnan Masood www.AdnanMasood.com www.CodePlex.com/YABE.

Slides:



Advertisements
Similar presentations
Introduction to ASP.NET MVC
Advertisements

Apache Struts Technology
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
{ Model View Controller ASP.NET By Scott Crooks & Maggie Wettergreen.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Fabian Vilers Hands on ASP.NET MVC.
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
Online Magazine Bryan Ng. Goal of the Project Product Dynamic Content Easy Administration Development Layered Architecture Object Oriented Adaptive to.
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 │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
AMS304: Introduction to the ASP.NET Model View Controller (MVC) Framework Scott Hanselman Eilon Lipton Microsoft Microsoft
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
DSpace XML UI Project Texas A&M University Digital Initiatives, Research and Technology Scott Phillips, Cody Green, Alexey Maslov, Adam Mikeal, Brian Surratt,
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Ori Calvo, 2010 Hi-Tech College
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
Creating Business Workflow Using SharePoint Designer 2007 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft SQL Server.
ZFApp Preview Walkthrough. What is ZFApp? ZFApp is an application framework built on top of Zend Framework Fully compatible with the latest ZF Versions.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Presenter - Donn Felker.  Senior Consultant for Microsoft Gold Certified Partner- Statêra.  8 years of experience in developing and architecting enterprise.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
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
Introducing Reporting Services for SQL Server 2005.
The West Wind Web Connection 5.0 Web Control Framework The West Wind Web Connection 5.0 Web Control Framework An overview of the new Web Control Framework.
Introduction to Model-Glue Rachel Lehman Perpetual Intermediate Designer-Developer Introduction to Model-Glue.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
Asp.Net MVC Adnan Masood Jeff Bergman Sean Xiao. Why MVC? Very Clean separation of Concerns Very Clean separation of Concerns Unit Testing Unit Testing.
Building Secure Web Applications With ASP.Net MVC.
H OW TO BUILD A S IMPLE REST BASED SERVICE IN WCF Adnan Masood
Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
J. Michael Palermo IV Director of Development Interface, USA WUX203.
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
Model View Controller MVC Web Software Architecture.
Christopher M. Pascucci.NET Programming CodeBehind.
Putting Performance Best Practices Together to Create the Perfect SPA Chris Love2Dev.com.
2 ASP.NET MVC Scott Hanselman Senior Program Manager Microsoft.
Getting started with ASP.NET MVC Dhananjay
ASP.Net MVC Extensibility, scalability and testability Andrew Locatelli Woodcock.
ASP.NET MVC Telerik Academy
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.
2 Architectural Considerations for the ASP.NET MVC Framework Jeffrey Palermo Chief Technology Officer Headspring Systems Austin, TX Session Code: ARC402.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
Apache Struts Technology A MVC Framework for Java Web Applications.
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
//liveVirtualacademy2011/ What’s New for ASP.NET 4.5 and Web Development in Visual Studio 11 Developer Preview Γιώργος Καπνιάς MVP, MCT, MCDP, MCDBA, MCTS,
INTRODUCTION TO MVC BY SUHA MNEIMNEH. WHAT’S THE AGENDA What is MVC? MVC components MVC vs web forms vs ASP.NET vocabulary When to create MVC application.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Introducing the Microsoft® .NET Framework
Introduction to .NET Florin Olariu
Social Media And Global Computing Introduction to The MVC Pattern
Introduction to ASP.NET 2.0
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.
The Application Lifecycle
ASP.NET Module Subtitle.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
Introduction to ASP.NET Parts 1 & 2
.NET Framework V3.5+ & RESTful web services
Presentation transcript:

Introduction to ASP.NET MVC Blogging Engine in 60 minutes Adnan Masood

About Me aka. Shameless Self Promotion Sr. Software Engineer / Tech Lead for Green Dot Corp. (Financial Institution) Design and Develop Connected Systems Involved with SoCal Dev community, co-founded San Gabriel Valley.NET Developers Group. Published author and speaker. MS. Computer Science, MCPD (Enterprise Developer), MCT, MCSD.NET Doctoral Student - Areas of Interest: Machine learning, Bayesian Inference, Data Mining, Collaborative Filtering, Recommender Systems. Contact at Read my Blog at Doing a session in IASA 2008 in San Francisco on Aspect Oriented Programming; for details visit

YABE Yet another blogging engine Team – Adnan Masood – Jeff Bergman – Sean Xiao Uses Linq to SQL for data access Syndication Libraries for the RSS/Atom Feeds Experiment in learning MVC

Latest Developments in the MVC world Scott Guthrie, adaptation from RoR How does this relate to Visual Studio 2008/.NET 3.5 SP1 Beta? It doesn't. For now ASP.NET MVC is an out-of-band Web downloadable thing. It's bin deployable (meaning you don't HAVE to put them in the GAC) and you don't even need to tell your hosting/ISP. They are what they are - three DLLs in a folder. Bam. MVC Preview 3 will not be affected by having SP1 installed. Preview 3 will include newer privately versioned bin deployable builds of the Routing and Abstractions DLLs. That way these assemblies will not be affected by the versions in the GAC installed by SP1, because they will have different version numbers.

MVC vs. “Classic” ASP.NET

Ok, so what is this MVC thingy? It is an ASP.NET framework that performs data exchange by using a REST model versus the postback model of classic ASP.NET. Each page is split into two distinct components - controller and view - that operate over the same model of data. This is opposed to the classic code-behind model where no barrier is set that forces you to think in terms of separation of concerns and controllers and views. However, by keeping the code-behind class as thin as possible, and designing the business layer appropriately, a good developer could achieve separation of concerns even without adopting MVC and its overhead. MVC, however, is a model superior to a properly-done code-behind for its inherent support for test-driven development.

Model View Controller Pattern

More Concrete Model View Controller Pattern

Why use ASP.NET MVC? It enables clean separation of concerns, testability, and TDD by default. All core contracts within the MVC framework are interface based and easily mockable (it includes interface based IHttpRequest/IHttpResponse intrinsics). You can unit test the application without having to run the Controllers within an ASP.NET process (making unit testing fast). You can use any unit testing framework you want to-do this testing (including NUnit, MBUnit, MS Test, etc). It is highly extensible and pluggable. Everything in the MVC framework is designed so that it can be easily replaced/customized (for example: you can optionally plug-in your own view engine, routing policy, parameter serialization, etc). It also supports using existing dependency injection and IOC container models (Windsor, Spring.Net, NHibernate, etc). It includes a very powerful URL mapping component that enables you to build applications with clean URLs. URLs do not need to have extensions within them, and are designed to easily support SEO and REST-friendly naming patterns. For example, I could easily map the /products/edit/4 URL to the "Edit" action of the ProductsController class in my project above, or map the /Blogs/scottgu/ /SomeTopic/ URL to a "DisplayPost" action of a BlogEngineController class. The MVC framework supports using the existing ASP.NET.ASPX,.ASCX, and.Master markup files as "view templates" (meaning you can easily use existing ASP.NET features like nested master pages, snippets, declarative server controls, templates, data-binding, localization, etc). It does not, however, use the existing post-back model for interactions back to the server. Instead, you'll route all end-user interactions to a Controller class instead - which helps ensure clean separation of concerns and testability (it also means no viewstate or page lifecycle with MVC based views). The ASP.NET MVC framework fully supports existing ASP.NET features like forms/windows authentication, URL authorization, membership/roles, output and data caching, session/profile state management, health monitoring, configuration system, the provider architecture, etc.

Why MVC is so different? REST is an architectural pattern that defines how network resources should be defined and addressed in order to gain shorter response times, clear separation of concerns between the front-end and back-end of a networked system. REST is based on three following principles: An application expresses its state and implements its functionality by acting on logical resources Each resource is addressed using a specific URL syntax All addressable resources feature a contracted set of operations

The answer to Url’s Life, 42. In the MVC Framework, a URL is seen as the mean to address a logical server resource, but not necessarily an ASPX file to parse. So the URLs employed by the pages of an MVC Framework application have a custom format that the application itself mandates. In the end, the MVC Framework employs a centralized HTTP handler that recognizes an application-specific syntax for links. In addition, each addressable resource exposes a well-known set of operations and a uniform interface for executing operations.

What? No more postbacks! The MVC Framework doesn't support classic postbacks and viewstate and doesn't consider any URL as the endpoint to a physical server file to parse and compile to a class. In ASP.NET, you have a 1:1 correspondence between a URL and a resource.

Why MVC? (links) The REST-like Aspect of MVC Framework ASP.NET MVC Framework: An early look RSS Feed with the new ASP.NET MVC Framework RSS Feed with the new ASP.NET MVC Framework MVC, REST, and the Alternative ASP.NET Framework MVC, REST, and the Alternative ASP.NET Framework ASP.NET MVC framework - ready or not

Why MVC? Very Clean separation of Concerns Unit Testing Model that leads you down a maintainable path (prevent crappy code) Clean Urls and Html

Front Controller Classic asp.net framework is Page Controller Map Urls to classes/controllers instead of Pages

Unit Testing Mock Objects to simulate responses. Don’t have to go through a page or view Red/Green Testing

Unit Testing Create instance of controller controller.ViewEngine = new TestViewEngine(); Uses Mock Objects

Features Routing Controller View Dependency Injection Pluggable Interfaces for all core contracts

Url Url no longer points to the view/aspx page A Url maps to a controller class Allows more flexibility to map Urls Url routing engine, Route table Routes are tokenized strings Can use RegEx

Route Examples / / Html.Link for creating outbound urls Html.Link(,, )

Controller IController Execute(IHttpContext ctx, RouteData routeData) class MyController : Controller [ControllerAction] attribute

View Similar to existing page No postback or view state Not all page events will fire Editing forms will be more work Separate page for viewing, editing, and updating Ajax will use UserControls as update panels but request still goes through the control

Views View probably shouldn’t directly access data sources or services. Use the ViewData which stores the model the view is rendering ViewPage, ViewPage

Future of the ASP.NET MVC MVC for the Enterprise Classic Asp.Net for quicker implementations

References Download the Latest MVC Preview 3 A8F F9A-FCF6BC9F66AB&displaylang=en A8F F9A-FCF6BC9F66AB&displaylang=en ASP.NET MVC Preview Quick Start Guides Upcoming Changes in Routing routing.aspx routing.aspx Scott Guthrie’s Post on ASP.NET MVC Framework framework.aspx

Questions? ASP.NET MVC is a new paradigm for.NET Developers; a new way to think about programming web application. Any Questions / Comments … feel free to contact Visit Visit