Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jean-Claude Trachsel Senior Consultant Trivadis AG Building a Website with ASP.NET MVC.

Similar presentations


Presentation on theme: "Jean-Claude Trachsel Senior Consultant Trivadis AG Building a Website with ASP.NET MVC."— Presentation transcript:

1 Jean-Claude Trachsel Senior Consultant Trivadis AG Building a Website with ASP.NET MVC

2

3 IT SOLUTIONS, SERVICES, & PRODUCTS TECHNOLOGIES Microsoft, Oracle, IBM, Open Source Integration, Application Performance Management, Security TrainingManaged Services Infrastructure Engineering Application Development Enterprise Content Management BUSINESS INTEGRATION SERVICES IT departments Business departments CUSTOMER Business Intelligence Trivadis solutions portfolio and competences

4 Hamburg Düsseldorf Frankfurt Stuttgart Munich Freiburg Vienna Basel Bern Zurich Lausanne ~370 employees ~170 employees ~20 employees Trivadis facts & figures 11 Trivadis locations with more than 550 employees Financially independent and sustainably profitable Key figures 2010 Revenue CHF 101 / EUR 73 mio. Services for more than 700 clients in over 1‘800 projects Over 170 Service Level Agreements More than 5'000 training participants Research and development budget: CHF 5.0 / EUR 3.6 mio.

5 Agenda What is ASP.NET MVC Building a Website Features we need to know

6 What is ASP.NET MVC Web Development Framework Based on the ASP.NET Framework Based on the MVC Design Pattern Acronym for Model ● View ● Controller Separation of concerns

7 ASP.NET Web Forms ASP.NET MVC ASP.NET Framework.NET Framework

8 Technologie Focus ASP.NET WebForms Make Web Development fast and easy Hide Web Specifica WinForms similar Programming Model  Statefull, event driven, many rich controls ASP.NET WebForms Make Web Development fast and easy Hide Web Specifica WinForms similar Programming Model  Statefull, event driven, many rich controls ASP.NET MVC Full Control Web Development Great Testability, Maintainability and Extensibility  Stateless, trendy, separation of concerns, perfect ajax integration ASP.NET MVC Full Control Web Development Great Testability, Maintainability and Extensibility  Stateless, trendy, separation of concerns, perfect ajax integration

9 Agenda What is ASP.NET MVC Building a Website Features we need to know

10 Build a website in 5 steps AdventureWorks DB CRUD Functionality for Vendor table

11 Setup the Solution

12 Model Business Logic Layer Data Access Layer Architecture Repository Pattern Services Layer This is not ASP.NET MVC specific Model

13 Demo Architecture MVC Project Controller View Model Data Project Entity Framework Model DataAnnotations Services Project IEn…on GetItems(); T GetItem(int id); void Save(); IEn…on GetItems(); T GetItem(int id); void Save(); IRepository IEnumeration GetItems(); T GetItem(int id); void Save(); IEnumeration GetItems(); T GetItem(int id); void Save(); VendorRepository Model

14 Define the Model

15 Controller Class in C# (VB) Handles all interactions and requests Controller base class Provides many helper methods Action Return Values For testing purpose Controller

16 Build the Controller

17 View Aspx or Razor (.cshtml) File No Code Behind File Controls No Server Controls (no ViewState) Pure HTML Code Presentation Logic in C# (VB) or JavaScript Html Helper class Views

18 Build some Views

19 Test Controller Logic Seperate Test Projects Views Models Usefull tools Dependency Injection (DI) Mock Framework Unit Test

20 Build a Unit Test

21 Agenda What is ASP.NET MVC Building a Website Features we need to know

22 Validation Supports DataAnnotations Features Attributes on the model Generates Client- and Server Code.NET 4 DA-Features Support (Version 3 Feature) IsValid overloads in the ValidationAttribute IValidatableObject Interface Remote Validation Attribute (Version 3 Feature) Defines Controller and Action for jQuery validation

23 Filters Aspect Oriented Programming (AOP) Framework Integrated in ASP.NET MVC Standard Filters [HandleError], [Authorize], [OutputCache] Base class for your own filter Global Filters (Version 3 Feature) Conditional filters thru IFilterProvider

24 Compact, Expressive and Fluid Easy to learn Is not a new language Works with any Text Editor Visual Studio provides Intellisense and syntax highlighting

25 1 character instead of 5 for code blocks Razor: @ (no closing tag needed) Parser has semantic knowledge of C# / VB Aspx: Coding is fast, fluid and fun

26 “Hello world” sample " %> Razor Demo Razor Demo Hello World, we got Number 1: and Number 2:. @model Trivadis.Models.Product @{View.Title = "Razor Demo";} Razor Demo Hello World, we got Number 1: @Model.Number1 and Number 2: @Model.Number2. Razor aspx

27 http://www.asp.net/mvc http://haacked.com/ http://stephenwalther.com/blog/ http://weblogs.asp.net/scottgu/ http://blog.trivadis.com/blogs/

28 Trivadis TechDays11 Wettbewerb

29

30 © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Jean-Claude Trachsel Senior Consultant Trivadis AG Building a Website with ASP.NET MVC."

Similar presentations


Ads by Google