ASP NET MVC Development with Sarp Architecture Alvin

  • Slides: 19
Download presentation
ASP. NET MVC Development with S#arp Architecture Alvin Ashcraft Eclipsys Corporation / DZone. com

ASP. NET MVC Development with S#arp Architecture Alvin Ashcraft Eclipsys Corporation / DZone. com alvin@dzone. com

Session Agenda �Introduction – Who Am I? �Model-View-Controller pattern & ASP. NET MVC �NHibernate,

Session Agenda �Introduction – Who Am I? �Model-View-Controller pattern & ASP. NET MVC �NHibernate, Fluent NHibernate & MVCcontrib �The S#arp Archtecture Project �Building a S#arp Architecture Application �Summary �Additional Resources

Introduction – Who Am I? � 14 Years Development Experience � Software Engineer at

Introduction – Who Am I? � 14 Years Development Experience � Software Engineer at Eclipsys Corporation – Malvern, PA � Contributing Editor at DZone’s. NET Zone – http: //dotnet. dzone. com � MCSD, MCAD, MCDBA, MCSE, MCSA, Comp. TIA ITProject+ Certifications � Microsoft Most Valuable Professional (MVP) – Awarded April 2009 � Alvin Ashcraft’s Morning Dew – http: //www. alvinashcraft. com

The Model-View-Controller (MVC) Pattern � MODEL – Business logic plus one or more data

The Model-View-Controller (MVC) Pattern � MODEL – Business logic plus one or more data sources such as a relational database. � VIEW – The user interface that displays information about the model to the user. � CONTROLLER – The flow- control mechanism means by which the user interacts with the application.

ASP. NET MVC 1. 0 �Released April 9, 2009 �Alternative to ASP. NET Web.

ASP. NET MVC 1. 0 �Released April 9, 2009 �Alternative to ASP. NET Web. Forms �Built for testability �User-friendly (and SEO-friendly) URLs �Clear separation of concerns �Lacks rich control set available with Web. Forms �Demo – ASP. NET MVC 1. 0 Project Structure

NHibernate � Object-Relational Mapping (ORM) Tool � Map data to your domain objects (.

NHibernate � Object-Relational Mapping (ORM) Tool � Map data to your domain objects (. hbm. xml mapping files) � Manipulate persistent data � Handle transactions and concurrency

Fluent NHibernate � An alternative to NHibernate's standard XML mapping files. � Write mappings

Fluent NHibernate � An alternative to NHibernate's standard XML mapping files. � Write mappings in strongly typed C# code. � Benfits: Refactoring Readability Concise � Fluent mapping � Automapping � Fluent database configuration

MVCcontrib Project � Adds functionality on top of the MVC Framework UI Helpers Routing

MVCcontrib Project � Adds functionality on top of the MVC Framework UI Helpers Routing Filters View Engines Lots More… � http: //mvccontrib. org

The S#arp Architecture Project �Owner & Creator: Billy Mc. Cafferty �Project Members Frank Laub

The S#arp Architecture Project �Owner & Creator: Billy Mc. Cafferty �Project Members Frank Laub Simone Busoli Kyle Baley �Rapidly build maintainable web applications. �Leverage ASP. NET MVC, NHibernate and Spring. NET. �Ignore infrastructure. Focus on domain and UX.

S#arp Architecture Principles �DDD-Focused �Loosely Coupled �Preconfigured Architecture �Open-Ended Presentation j. Query Yahoo UI

S#arp Architecture Principles �DDD-Focused �Loosely Coupled �Preconfigured Architecture �Open-Ended Presentation j. Query Yahoo UI Widgets ASP. NET AJAX

S#arp Architecture Project Tiers

S#arp Architecture Project Tiers

Configuring the Development Environment �Detailed Documentation in S#arp Architecture Reference Guide document. �Software Prerequisites

Configuring the Development Environment �Detailed Documentation in S#arp Architecture Reference Guide document. �Software Prerequisites Visual Studio 2008 SP 1 NUnit v 2. 4. 8 T 4 Toolbox v 9. 1. 20. 1 ASP. NET MVC 1. 0 �Install Visual Studio S#arp Architecture Project Template �Configuring IIS �Demo - Configuration

Building a Simple Application Overview � Music Store Chinook Database 1. 1 (www. codeplex.

Building a Simple Application Overview � Music Store Chinook Database 1. 1 (www. codeplex. com/Chinook. Database) � Index will list data for entities Artists Albums Tracks Playlists Customers Invoices � Create/Edit records � Demo – Create the Project

Mapping the Model to the Data �Manual Mapping XML Mapping Fluent NHibernate �CRUD Scaffolding

Mapping the Model to the Data �Manual Mapping XML Mapping Fluent NHibernate �CRUD Scaffolding �Demo – Mapping Data

Music Catalog – Feature Options �Filtering View Data �Using Custom View Data to Access

Music Catalog – Feature Options �Filtering View Data �Using Custom View Data to Access Multiple Repositories (Entity Lists) �Support for Different View Engines �Add some j. Query flair Submit via AJAX Add Edit-in-Place Add j. Query UI tabs j. Query Grid Options �Demo – Feature Options

Reminders! �Fill out your evals �Book & shirt giveaway �After Party @ Shanachie in

Reminders! �Fill out your evals �Book & shirt giveaway �After Party @ Shanachie in Ambler �All slides and sample code will be posted to Philly. NET site �Thank our sponsors!

DZone. Professional Refcardz Cheat Sheets for Developers! Silverlight 2 by Chad A. Campbell Core.

DZone. Professional Refcardz Cheat Sheets for Developers! Silverlight 2 by Chad A. Campbell Core. NET by Jon Skeet ASP. NET by Holger Schwichtenberg Design Patterns by Jason Mc. Donald Spring Confirguration by Craig Walls Windows Power. Shell by Bruce Payette j. Query Selectors by Bear Bibealt & Yehuda Katz OVER 45 TITLES, GET THEM ALL FREE AT WWW. REFCARDZ. COM

Additional Resources � � � � S#arp Architecture on Google Code: http: //code. google.

Additional Resources � � � � S#arp Architecture on Google Code: http: //code. google. com/p/sharp-architecture/ S#arp Architecture Discussion Group: http: //groups. google. com/group/sharp-architecture? pli=1 S#arp Architecture Community Site: http: //www. sharparchitecture. net/ S#arp Architecture Wiki: http: //wiki. sharparchitecture. net/default. aspx Billy Mc. Cafferty’s Blog: http: //devlicio. us/blogs/billy_mccafferty/default. aspx Virtual ALT. NET S#arp Architecture Presentation – 04/22 @ 10 pm: http: //twurl. nl/e 8 i 3 u 0 Dime. Casts. NET Episodes by Kyle Baley: http: //www. dimecasts. net � � � Episode #75: Introduction to S#arp Architecture Episode #97: Another look at Sharp Architecture: Validation, Design Decisions and Automapping Episode #102: Taking a look at how to modify the T 4 templates used by Sharp Architecture NHibernate Best Practices with ASP. NET: http: //www. codeproject. com/KB/architecture/NHibernate. Best. Practices. aspx Summer of NHibernate Screencast Series: http: //www. summerofnhibernate. com/ Rob Conery’s MVC Storefront Project: http: //blog. wekeroad. com/mvc-storefrontpart-1/ Stephen Walther’s ASP. NET MVC Application Building Series: http: //stephenwalther. com/blog/category/2. aspx James Gregory’s Blog (Fluent NHibernate): http: //blog. jagregory. com/2008/08/08/introducingfluent-nhibernate/ Great ASP. NET MVC & NHibernate Bloggers: Phil Haack, Scott Guthrie, Scott Hanselman, Simone Chiaretta, Keyvan Nayyeri, Nick Berardi, Oren Eini, Derik Whittaker, Tim Barcz, Ben Scheirman, and more…

ASP. NET MVC with S#arp Architecture Alvin Ashcraft

ASP. NET MVC with S#arp Architecture Alvin Ashcraft