2 Architectural Concerns for Object/Relational Mappers (O/R-M) with Examples in NHibernate Jeffrey Palermo Chief Technology Officer Headspring Systems, LP Session Code: ARC401
3 Architecture? What type are we speaking of? - Application architecture - Enterprise applications (lots of code) level
4 Top Concerns for O/R Mappers Compatibility Loose Coupling Testing Changing Schema Reporting Mapping Boundaries
5 Audience Participation Raise your hand if you are using the same data access method that you were 1 year ago.
6 2 Years
7 3 Years
8 4 Years
9 5 Years
10 6 Years
11 7 Years
12 8 Years
13 9 Years
14 10 Years
15 How will you switch to the next thing?
16 Compatibility
17 OBJECT / relational mapping
18
19 Loose Coupling
20 Traditional Layered Architecture Data Business Logic UI Infrastructure
21 Web Service File Solution Structure Client Business Logic Data Access DB Infrastructure
22 Layered Onion Architecture Domain Model Domain Services Application Services User Interface Infrastructure Tests DB Web Service File Application Core
23 Web Service File Solution Structure Client Core Infrastructure DB IoC Container
24 Loose Coupling (loose coupling means no project reference)
25 Testing
26 Testing (I can test anything it if has well-defined boundaries)
27 Testing
28 Testing Data Access Local database Test setup Test execution Test teardown Automate, Automate, Automate
29 Testing (I can test anything it if has well-defined boundaries)
30 Changing Schema
Table Per Type Mapping..
Table Per Hierarchy Mapping
33 Table Per Type Mapping
34 Table Per Hierarchy Mapping
35 Changing Schema
36 Reporting
37 Mapping Boundaries
38
39 Mapping tips Use collection mappings only where necessary Leverage component mappings Keep database details in the database Don’t expose collections as properties (do you support collection.Clear())?
40 Use any good O/R Mapper Keep it behind interfaces Application logic and business objects shouldn’t depend on ORM
41
Related Content Interactive Theater Sessions WUX08-TLC TDD, DI, and Other Acronyms with ASP.NET MVC Friday, 1PM-2:15PM
43 About me CTO, Headspring Systems Software management consultant Agile coach MCSD.Net Microsft MVP, ASPInsider Certified ScrumMaster Director, Austin.Net User Group Board member, AgileAustin INETA speakers bureau U.S. Army Veteran Party with Palermo Agile Boot Camp:
Tech·Talks Tech·Ed Bloggers Live SimulcastsVirtual Labs Developer’s Kit, Licenses, and MORE! Resources for Developers
45 © 2008 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.