Upload
bryan-cornelius-warner
View
220
Download
2
Embed Size (px)
Citation preview
Introduction to Object-Relational Mapping for .NET
Little ‘bout Me
• dotNetTemplar.Net• ASP.NET MVP• ASPInsiders• ASPAlliance.com• GTE
Federal Credit Union• Life Beyond the Bits
What is Object-Relational Mapping?
• The need for RDBMS.• The need for OOD/OOP.• The need for OOD/OOP to talk to RDBMS.• The need for RAD and long-term manageability.
Problems
• Querying• Updating• Mapping• Performance
Solutions
• Querying: OPath, Query Builder, Sprocs, Etc.• Updating: SQL, Commands, Transactions, Etc.• Mapping: XML/text files, Attributes.• Performance: Caching
Mapping• XML Configuration (Wilson O/R Mapper)
• XML Configuration (NHibernate)
Mapping
• Custom Attributes (DataAspects)
Querying• OPath (an OO SQL/XPath)
• Query Building (NHibernate)
Querying• Query Building (eXpress Persistent Objects)
• (DefaultAddress.City <> "Chicago" AND not (Company is null))
Querying
• Stored Procedures and Dynamic T-SQL• Custom Attributes (DataAspects)
Updating
• Commands and SQL Generation
• Use Mappings to Generate Commands and Parameters and, optionally, T-SQL.
Updating
• Transactions
Performance
• Is this as fast as straight, hand-written (or generated) ADO.NET?– Compared to 2-tier?– Compared to n-tier?
• 1000 DataAspects CRUD operations took 5046.8427 milliseconds.
• 1000 straight ADO.NET CRUD operations took 5281.2162 milliseconds.
• How is this possible?
Extensibility
• Does your O-R mapper allow you to use more than one database?
Some Examples
Future Features
• Built-In Paging Procedure Generation
• Easier API for Collections
• More Options for Querying
• VB Examples
Other Resources
• DotNetTemplar – http://dotNetTemplar.net• Get Demo Project & Library - http://dotNetTemplar.Net/Downloads/LearnDataAspects.zip
• Object Spaces
– http://msdn.microsoft.com/data/winfs/
– http://blogs.msdn.com/aconrad/
• WilsonORMapper
– http://www.wilsondotnet.com/
• eXpress Persistent Objects
– http://www.devexpress.com/products/NET/XPO/
• Other O-R Libraries (Some Free, Some Not)
– http://url123.com/z7mqb