Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction To NHibernate

4,878 views

Published on

Introduction to NHibernate O/R mapper technology

Published in: Technology
  • Be the first to comment

Introduction To NHibernate

  1. 1. <ul><li>Emad Alashi </li></ul><ul><li>Technical Team Leader in eSense software </li></ul><ul><li>http:// eashi.wordpress.com </li></ul><ul><li>emad.ashi@ gmail.com </li></ul>
  2. 3. <ul><li>Most of the applications in the business world are data-centralized (yes…database!): </li></ul><ul><ul><li>1- Retrieve data from DB </li></ul></ul><ul><ul><li>2- Process data </li></ul></ul><ul><ul><li>3- Save data to DB </li></ul></ul>DB
  3. 4. Connections, Transactions,… Insert Commands Update Commands Delete Commands Retrieve Commands Convert to BO Domain Objects DB
  4. 6. <ul><li>Code writing: </li></ul><ul><ul><li>SQL queries and SP </li></ul></ul><ul><ul><li>DB connectivity objects (connections, commands…etc) </li></ul></ul><ul><ul><li>CRUD Operations (Create, Read, Update, Delete) </li></ul></ul><ul><ul><li>Integrity (scalar to OO, object identity…etc) </li></ul></ul><ul><li>Code maintenance: </li></ul><ul><ul><li>Look above! </li></ul></ul>
  5. 7. Domain Objects Configuration DB Connections, Transactions,… Insert Commands Update Commands Delete Commands Retrieve Commands Convert to BO
  6. 8. <ul><li>Programming technique for converting data types between relational databases and object-oriented programming languages (Wikipedia) </li></ul><ul><li>OOP vs. Relational </li></ul><ul><li>Examples: </li></ul><ul><ul><li>Hibernate </li></ul></ul><ul><ul><li>ORM.net </li></ul></ul><ul><ul><li>ObjectMapper </li></ul></ul><ul><ul><li>Genome </li></ul></ul><ul><ul><li>NPersist…etc </li></ul></ul>
  7. 9. Database XML mapping file Domain Object
  8. 11. <ul><li>O/R mappers benefits: </li></ul><ul><ul><li>Productivity: less code to write/maintain </li></ul></ul><ul><ul><li>Abstraction: transient to different DB technologies </li></ul></ul><ul><ul><li>Consistency </li></ul></ul><ul><ul><li>Quality: depending on the product </li></ul></ul><ul><li>Challenges: </li></ul><ul><ul><li>Learning curve </li></ul></ul>
  9. 12. <ul><li>Session and SessionFactory </li></ul><ul><li>Objects Identity </li></ul><ul><li>Collections (one-to-many, many-to-one, many-to-many) </li></ul><ul><li><Union> </li></ul><ul><li>Inheritance </li></ul><ul><li>ICriteria </li></ul><ul><li>HQL </li></ul><ul><li>Caching </li></ul><ul><li>Interceptors </li></ul><ul><li>Performance Tuning </li></ul><ul><li>… </li></ul>
  10. 13. <ul><li>http://en.wikipedia.org/wiki/Object-relational_mapping </li></ul><ul><li>http://davidhayden.com/blog/dave/archive/2005/03/19/876.aspx </li></ul><ul><li>www.hibernate.org </li></ul><ul><li>http://forum.hibernate.org/viewtopic.php?t=952439 </li></ul><ul><li>http://www.theserverside.net/tt/articles/showarticle.tss?id=NHibernate </li></ul><ul><li>http://www.codeproject.com/KB/database/Nhibernate_Made_Simple.aspx </li></ul><ul><li>http://groups.google.com/group/nhusers </li></ul>
  11. 14. Thanks for attending http://eashi.wordpress.com [email_address]

×