Download presentation
Presentation is loading. Please wait.
Published byHerbert Nash Modified over 9 years ago
1
Jean-Claude Trachsel Senior Consultant, Trivadis AG jean-claude.trachsel@trivadis.com The good news
2
What is ASP.NET MVC Features of Version 2 What about the «real life»? Summary
3
A short introduction
4
Framework based on Model-View-Controller Pattern Separation of Concerns Framework is focusing on... Pure Web Development Stateless, no ViewState Full control over markup Testability TDD, Unit Tests Maintainability Extensibility and Flexibility Modern aspects like AOP, DI, IoC
5
ASP.NET Web Forms ASP.NET MVC ASP.NET Framework.NET Framework
6
Visual Studio Template Controller and View Unit Test
7
Areas, Validation, Typed UI Helpers, etc.
8
Goals of the DevTeam for Version 2 More Productivity More Security More Performance More Extensibility More Happiness
9
Areas Validation Typed UI Helpers UI Helper Templates Async Controllers
10
Single Project and Multi Project Areas
11
Enterprise ready with Areas Structure your Solution with... Single Project Area Multi Project Area Easy re-use of Code
12
Single Project Area Folder Structur Route Class Inherits from AreaRegistration Defines the route to the Controller Global.asax Register the area routes
13
Single Project Areas
14
Data Annotations Attributes
15
Data Validation with DataAnnotations Attributes Introduced with.NET 3.5 SP 1 Benefits of DataAnnotations Attributes Set in one central place, on the model Used by different Technologies Used in ASP.NET Dynamic Data Used in WCF RIA Services
16
Set Attributes on the Model [MetadataType(typeof(ProductMetadata))] public partial class Product { } public class ProductMetadata { [Required] public string Name { get; set; } }
17
Attributes that are available Required Range RegularExpression StringLength CustomValidation Build your own
18
Server Site Validation ModelBinder Class Client Site Validation jQuery Validation Library
19
Validation with DataAnnotation Attributes Server- and Client Site
20
...and the UI Helper Templates
21
HtmlHelper Extensions ASP.NET MVC 1 ASP.NET MVC 2 p.ProductID)%>
22
Benefits are... Intellisense Compile Time Support Type based rendering Support for standard and complex types
23
Extend the Typed UI Helper Methods Define the Rendering via UserControls Supports standard and complex types Used by... Name Convention UI Helper Method Parameter ViewModel Attributes
24
Typed UI Helpers UI Helper Template for DateTime
25
Be smart, be fast
26
public class HomeController : AsyncController { public void NAMEAsync() { AsyncManager.OutstandingOperations.Increment(3); // Do all Tasks asynchronouse } public ActionResult NAMECompleted(object params) { // Do final work return View("NAME"); }
27
Async Controller is a Server Side Pipeline For Async Clinet/Server Requests use AJAX Do Multiple Tasks at once Get data from different stores at the same time Prevent Blocking of the Webserver Worker Threads are not blocked No Thread starvation
28
Use synchronouse pipelines Operations are simple or short-running Simplicity is important Use asynchronouse pipelines Operations are network-bound or I/O-bound Parallelism is important Provide a mechanism to cancel long-running request
29
Async Controllers
30
Experience from current projects
31
It’s a Paradigm Shift Can be hard for MS Win-/WebForms Developers Easier for PHP, Java, etc. Developers It’s a lot of Client Side Programming New Know-How is needed
32
Convention over Configuration Easy to understand New Team Members Maintenance More Unit Tests Better Quality Less Bugfixing Better Reusability
33
No reuse of existing... Concepts Frameworks Controls Loss of Functionality (GUI)Libraries
34
3, 2, 1, go
35
New Web Development Paradigm perfect for... TDD, Large Projects and Teams Many new Features to gain... Productivity and happiness Use ASP.NET MVC When ever you can Use ASP.NET WebForms Need to use existing Frameworks, Libs or Controls No time to establish needed Know-How
36
Productivity Tasked based helpers Validation Improvements Ajax Multiple Partial Updates Client Templates Support Architecture Dependency Injection at all levels MEF Controller (Managed Extensibility Framework) Performance Improved Caching More Control over Session
37
Websites http://www.asp.net/mvc http://www.codeplex.com/aspnet Blogs http://www.haacked.com/ http://weblogs.asp.net/scottgu http://www.hanselman.com http://stephenwalther.com/blog
38
For more Information please contact Jean-Claude Trachsel Senior Consultant jean-claude.trachsel@trivadis.com 076 4000 900 Trivadis AG Europastrasse 5 8152 Glattbrugg
39
Besuchen Sie unseren Stand
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.