1 / 26

ASP.NET Extensions

ASP.NET Extensions. Jakob Tikjøb Andersen jta@miracleas.dk +45 25 277 105. HVEM ER JEG?. Technical Teamlead Opgaver Offentlig indkøbsportal og eFakturerings projekt Performanceoptimering og arkitektur Generelt konsulentarbejde/brandslukning Teknologi Primært Microsoft teknologi

alijah
Download Presentation

ASP.NET Extensions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ASP.NET Extensions Jakob Tikjøb Andersen jta@miracleas.dk +45 25 277 105

  2. HVEM ER JEG? • Technical Teamlead • Opgaver • Offentlig indkøbsportal og eFakturerings projekt • Performanceoptimering og arkitektur • Generelt konsulentarbejde/brandslukning • Teknologi • Primært Microsoft teknologi • Krydret med OSS som nHibernate, Castle, Watin, iBatis, nUnit m.fl. • Interresante steder på nettet • http://www.intellect.dk/ (Blog) • http://www.miracleas.dk/ (Arbejde) • http://www.cnug.dk/ (Copenhagen .NET User Group)

  3. Hvem er i?

  4. AGENDA • ASP.NET MVC • ASP.NET Dynamic Data Stil hellere end gerne spørgsmål undervejs!

  5. Model View Controller ASP.NET MVC

  6. MODEL • Indeholder vores forretningslogik • Facade/Service/Manager klasser • Typisk • Adgang til database • Adgang til webservices • Beregningslogik o.lign. Model View Controller

  7. VIEW • Brugergrænsefladen • HTML, Javascript, CSS osv. • Afspejler data fra modellen Model View Controller

  8. VIEW • Forskellige ViewEngines • Standard C#/VB.NET • ViewPage tilføjer • Helpers • AjaxHelper • HtmlHelper • TempData • ViewData • M.fl. • Ofte egen specialisering • Egne helpers • Filtre etc.

  9. VIEW • Eksempel på view

  10. VIEW • Udover ViewPage • ViewUserControl • ViewMasterPage

  11. CONTROLLER • Håndterer • Brugerinteraktion • Opdaterer data baseret på brugerens valg • Skifter view baseret på brugerens valg • Fodrer view med data fra model Model View Controller

  12. CONTROLLER Actions Action Filters ViewResult RedirectToRouteResult

  13. CONTROLLER

  14. BASECONTROLLER • WebFormViewFactory • Bestemmer hvordan views renderes • Kan udskiftes • Skriv din egen ViewEngine  • Der findes alternativer • Nhaml, Brail m.fl. • http://codeplex.com/mvccontrib

  15. MVC FLOW Indkommende request • MvcHttpHandler • Routing til korrekt controller • Controller • Find action • Bind Request data til parametre • Behandl evt. Filtre på action • Eksekver action MvcHttpHandler Routing table Initialisering Controller ViewEngine Redirect Udgående response

  16. WebFORMS vs MVC

  17. WEBFORMS • Eventbaseret • Statefull over HTTP • Tæt integreret • Basisfunktionalitet (Control -> Page) • Kontrolstruktur • Serverside ”UI” 3. partskomponenter • Svært at parralellisere udvikling

  18. MVC • Seperation of concern • Fuld kontrol • Routing • Let at teste • Let at bruge clientside 3. partskomponenter • Oplagt at parralellisere udvikling

  19. ASP.NET MVC – ”Hello world!” DEMO

  20. Hvorfor MVC?

  21. TESTABILITY - WEBFORMS Model Kan unit testes Page Controller Testes igennem UI

  22. TESTABILITY - MVC Model Kan unit testes View Controller Testes igennem UI

  23. MVC Testability DEMO

  24. TESTING MVC • Rig mulighed for Mocking • Alle centrale funktionaliteter er Interfaces • Mockede dependencies som parameter til constructor • MVC bruger som standard default contructor

  25. MVC EXTENSION POINTS • ControllerFactories • Helpers • Data Binders • ViewFactories

  26. ASP.NET Dynamic Data

More Related