1 / 17

TDD, DI, and SoC with ASP.NET MVC

TDD, DI, and SoC with ASP.NET MVC. Presented by Jeffrey Palermo CTO, Headspring Systems Microsoft MVP, MCSD.Net jpalermo@headspringsystems.com. Agenda. What is ASP.NET MVC? Sound architectural approach Soc – Separation of Concerns DI – Dependency Injection

caia
Download Presentation

TDD, DI, and SoC with ASP.NET MVC

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. TDD, DI, and SoCwith ASP.NET MVC Presented by Jeffrey Palermo CTO, Headspring Systems Microsoft MVP, MCSD.Net jpalermo@headspringsystems.com

  2. Agenda What is ASP.NET MVC? Sound architectural approach Soc – Separation of Concerns DI – Dependency Injection TDD – Test-Driven Development Questions

  3. INETA - The Face of .NET • World-wide association of .NET User Groups • 860+ groups world-wide • Over 810,000 developers • Started and run by .NET User Group leaders • Sponsors and supports both .NET and other professional user groups all around the world • Sponsors • Microsoft • Verio • New sponsors welcome! • North America (NorAm) INETA Speaker Bureau consists of 67 world-renowned speakers www.ineta.org

  4. What is ASP.NET? ASP.NET • HttpApplication • HttpContext • HttpRequest • HttpResponse • HttpRuntime • HttpUtility • IHttpHandler • IHttpModule WebForms • Server Lifecycle • Postback • ViewState ASPX • MasterPages • Themes, Skins • General Templating

  5. What is ASP.NET MVC? ASP.NET • HttpApplication • HttpContext • HttpRequest • HttpResponse • HttpRuntime • HttpUtility • IHttpHandler • IHttpModule Mvc • Routes • Controllers • ViewData • Filters • MvcContrib ASPX • MasterPages • Themes, Skins • General Templating

  6. Two types of architecture • Short-term • Long-lived

  7. Philosophy • Software Systems are complex • Maintainability is king • Simplicity rules • Abstraction and the human brain (7+/-2) • ASP.NET MVC is going away • Coupling to infrastructure

  8. Coupling (Architectural Metrics) • Afferent Coupling (Ca) – incoming dependencies • Efferent Coupling (Ce) – outgoing dependencies • Instability (I) • I = Ce / (Ce + Ca) (0 = stable, 1 = instable) • Stable = painful to modify • Abstractness (A) • # Abstract Types / # Total Types (0 = concrete assembly, 1 = abstract assembly)

  9. Traditional Layered Architecture UI Business Logic Data Access/Infrastructure

  10. Traditional Layered Architecture UI Business Logic Data Access WCF I/O

  11. Solution Structure UI Business Logic Web Service File Infrastructure Data Access DB

  12. Better layering UI I/O WCF Data Access Business Logic (service classes) Object Model (business logic)

  13. Onion Architecture LoginController IEmployeeRepository IUserSession User Interface Application Services HttpUserSession <<class>> Object Services Object Model EmployeeSelectList Employee Web Service Application Core Tests File Infrastructure EmployeeRepository <<class>> DB

  14. Solution Structure UI Core IoC Container Web Service File Infrastructure DB

  15. Demo ahead (all code)

  16. MvcContrib • http://mvccontrib.org • Founded by Eric Hexter and Jeffrey Palermo • Multiple view engines • ViewDataExtensions • IoC Container support • Html helpers • Extra ActionFilters • Anything else the community contributes

  17. About me • CTO, Headspring Systems • Agile coach • MCSD.Net • Microsft MVP, ASPInsider • Certified ScrumMaster • Austin .Net User Group • INETA speakers bureau • U.S. Army Veteran • Party with Palermo • www.partywithpalermo.com • Headspring’s Agile Boot Camp

More Related