160 likes | 296 Views
MVC Introduction. Content table. What is MVC MVC vs ASP.NET MVC development environment Your first MVC application. Goals. You know what is MVC, What MVC can do and cant do You know how to setup MVC development environment You know how to create a MVC project by visual studio.
E N D
Content table • What is MVC • MVC vs ASP.NET • MVC development environment • Your first MVC application
Goals • You know what is MVC, What MVC can do and cant do • You know how to setup MVC development environment • You know how to create a MVC project by visual studio
A Brief History 2002/03 1996 ASP.NET 1.0/1.1 CGI IDC ASP 2005 2007 2008 2009 ASP.NET 2.0 ASP.NET AJAX ASP.NET 3.5 ASP.NET MVC 1.0 2010 2011 2012 ASP.NET MVC 2.0 ASP.NET MVC 3.0 ASP.NET MVC 4.0
ASP.NET ‘s problem • View State weight • Page life cycle • False sense of separation of concerns • Limited control over HTML • Leaky abstraction • Low testability
MVC Partern • Modelscontain or represent the data that users work with. • View models represent data being transferred between views and controllers; • Domain models contain the data in a business domain as well as the operations, transformations, and rules for manipulating that data. • Views are used to render some part of the model as a UI. • Controllersprocess incoming requests, perform operations on the model, and select views to render to the user.
Some Other Pattern • Smart UI • View-Model • Three-Tier
Key Benefits of ASP.NET MVC • Extensibility • Tight Control over HTML and HTTP • Testability • Powerful Routing System • Built on the Best Parts of the ASP.NET Platform • Modern API • ASP.NET MVC Is Open Source
MVC vs ASP.NET • Asp.net is Stateful UI, using View State and postbacks to create the effect of statefulness. • MVC embraces HTTP’s true stateless nature
Migrate ASP.NET to MVC • two technologies can co-exist in the same application
MVC vs Ruby Rail • Rails is a holistic development platform. • MVC Framework focuses on handling web requests in an MVC-pattern with controllers and actions
MVC develop environment • Visual Studio 2010 ( Express, Pro, Pre, Ultimate ) • MVC 3 Update install • IIS Express • SQL Server ( 2005, 2008) • SQL management studio