Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA,...
-
Upload
berenice-golden -
Category
Documents
-
view
212 -
download
0
Transcript of Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA,...
![Page 1: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/1.jpg)
Object Relational Mapping A to Z
![Page 2: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/2.jpg)
About Me
Over A Decade of I.T. Experience
Web Developer,DBA, DevOps, Mobile
Microsoft Cert.in SQL Server
Twitter: @greeleygeekE-Mail: [email protected]
![Page 3: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/3.jpg)
Summary
• What an Object Relational Mapper Is
• Why you might use an Object Relational Mapper
• Problems using Object Relational Mapper
• Solutions to common issues
• Popular Object Relational Mapper examples
• Debugging
• Final Tips
![Page 4: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/4.jpg)
What Is It?
• Wikipedia: …”technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a ‘virtual object database’ that can be used from within the programming language”
• “Maps” set based data to objects useable by Object Oriented languages.
![Page 5: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/5.jpg)
What Is An ORM
![Page 6: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/6.jpg)
What is An ORM?
© Universal Studios. All rights Reserved.
![Page 7: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/7.jpg)
What Is An ORM?
• Database Management Systems: ~1960
• Object Oriented Programming: ~50s/60s
• One of the first ORMs was TopLink for SmallTalk in 1994
![Page 8: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/8.jpg)
Popular Flavors
![Page 9: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/9.jpg)
What Is An ORM?
![Page 10: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/10.jpg)
Object Impedance Mismatch
Wikipedia defines this as: “…conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being used by a program written in an object-oriented programming language or style; particularly when objects or class definitions are mapped in a straightforward way to database tables or relational schemata.”
![Page 11: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/11.jpg)
The “ORM problem”
http://upload.wikimedia.org/wikipedia/commons/7/76/Bruce_Crandall%27s_UH-1D.jpg
![Page 12: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/12.jpg)
Solutions
• Abandon the Object Model altogether returning to traditional methods
• Use a storage method that is object oriented itself (OODBMS, NoSQL possibly)
• Hand-crafting each Mapping
• Mix of ORM and SQL
• Integrate datasets into language itself (think LINQ)
• Build solution on relational concepts (blocks of data)
![Page 13: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/13.jpg)
The Good News
![Page 14: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/14.jpg)
Taking A Peek
![Page 15: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/15.jpg)
NHibernate Demo
![Page 16: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/16.jpg)
NHibernate Demo
![Page 17: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/17.jpg)
NHibernate Demo
![Page 18: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/18.jpg)
NHibernate Demo
NHibernate
![Page 19: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/19.jpg)
NHibernate Demo
![Page 20: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/20.jpg)
NHibernate Demo
![Page 21: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/21.jpg)
Nhibernate Demo
![Page 22: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/22.jpg)
NHibernate Demo
![Page 23: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/23.jpg)
Taking A Peek
![Page 24: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/24.jpg)
Entity Framework
![Page 25: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/25.jpg)
Entity Framework
![Page 26: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/26.jpg)
Entity Framework
![Page 27: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/27.jpg)
Entity Framework
![Page 28: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/28.jpg)
Entity Framework
![Page 29: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/29.jpg)
Entity Framework
![Page 30: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/30.jpg)
![Page 31: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/31.jpg)
Entity Framework
![Page 32: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/32.jpg)
Entity Framework
![Page 33: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/33.jpg)
Entity Framework
![Page 34: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/34.jpg)
Entity Framework
![Page 35: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/35.jpg)
Micro ORM
• Slimmed down ORMs
• What they lack in features they make up for in speed
• Popular flavors are PetaPoco and Dapper
![Page 36: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/36.jpg)
Massive
![Page 37: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/37.jpg)
Massive
![Page 38: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/38.jpg)
Massive
![Page 39: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/39.jpg)
Massive
![Page 40: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/40.jpg)
Massive Demo
![Page 41: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/41.jpg)
Debugging An ORM Demo
![Page 42: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/42.jpg)
ORM Pros
• Simpler for developers
• Supports many database platforms
• Supports many different languages
• The impedance mismatch is handled for us
• Developer can focus on the code, not the database
![Page 43: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/43.jpg)
ORM Cons
• Can be cumbersome to set up (NHibernate)
• Joins and complex queries can be difficult
• Hard to read performance metrics
• Another layer between the database and the application.
![Page 44: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/44.jpg)
Final Thoughts
• ORMs continue to advance
• Work for most solutions
• Consider stored procedures or views for finer control.
![Page 45: Object Relational Mapping A to Z. About Me Over A Decade of I.T. Experience Web Developer, DBA, DevOps, Mobile Microsoft Cert. in SQL Server Twitter:](https://reader037.fdocuments.us/reader037/viewer/2022110321/56649cec5503460f949b8d48/html5/thumbnails/45.jpg)
Code Links
• NHibernate Demo Source Code:https://github.com/anthem001/NHibernateDemo
• Entity Framework Demo Source Code:https://github.com/anthem001/EntityFrameworkDemo
• Massive Micro ORM Demo Source Code:https://github.com/anthem001/MassiveORMDemo
• Slides posted at: http://zero1design.com
Thanks!
Twitter: @greeleygeekE-Mail: [email protected]