Object/Relational Mapping in real-world applications
What is Object/Relational Mapping? <ul><li>Object/Relational Mapping (ORM) is a technique that allows programmers to map f...
Why is ORM being used? <ul><li>ORM leverages existing knowledge and skills related to OO programming and unifies the progr...
Important differences <ul><li>Several areas: </li></ul><ul><ul><li>Data Binding </li></ul></ul><ul><ul><li>Business Logic ...
Data Binding ADO.NET Data Binding DataTables, DataSets – query results ADO.NET ORM Data Binding? Name City Mike Reading Ru...
Data Binding ORM ADO.NET Fetch data IList IBindingList ITypedList ... ORM Fetch data Name City Mike Reading Ruth Liverpool...
Business Logic ADO.NET SQL Stored procedures (T-SQL, ...) Trigger code ... ADO.NET,  SQL code Functionality Functionality ...
Business Logic ORM SQL Stored procedures (T-SQL, ...) Trigger code ... ORM Functionality on the server implemented in .NET...
Demo <ul><li>Differences between ADO.NET and ORM based applications – Data Binding and Business Logic </li></ul>
Where does my Business Logic live? <ul><li>Several possibilities: </li></ul><ul><li>In the persistent classes themselves <...
When is Business Logic executed? <ul><li>More things to consider: </li></ul><ul><li>Automatically, e.g. when objects are c...
Important for Business Logic! Expectations regarding data consistency could be different when ORM is being used: suddenly ...
Important differences <ul><li>Several areas: </li></ul><ul><ul><li>Data Binding </li></ul></ul><ul><ul><li>Business Logic ...
Multi-Tier with ADO.NET Network – XML WebServices, WCF, ... Serialization Deserialization Result: Identical data! Name Cit...
Multi-Tier with ORM <ul><li>Objects contain more than just data </li></ul><ul><li>The ORM system does a lot of management ...
Multi-Tier with ORM Dynamic SQL Network Metadata Transport format Transport format / SQL Persistent Classes /  Query class...
Demo <ul><li>Tunnelling through .NET Remoting </li></ul>
Tunnelling is not specific to Remoting <ul><li>.NET Remoting is really easy to use, as it maps all .NET data types directl...
Further information <ul><li>My blog:  http://www.sturmnet.org/blog </li></ul><ul><li>My email:  [email_address] </li></ul>...
Upcoming SlideShare
Loading in...5
×

Object Relational Mapping In Real World Applications

2,131

Published on

Object Relational Mapping in real-world applications with Oliver Sturm

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,131
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
118
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Object Relational Mapping In Real World Applications

  1. 1. Object/Relational Mapping in real-world applications
  2. 2. What is Object/Relational Mapping? <ul><li>Object/Relational Mapping (ORM) is a technique that allows programmers to map fields and properties of classes to fields in relational database tables, and vice versa, in order to store object data in relational databases. </li></ul>
  3. 3. Why is ORM being used? <ul><li>ORM leverages existing knowledge and skills related to OO programming and unifies the programming model </li></ul><ul><li>ORM can provide a level of abstraction towards the database </li></ul><ul><li>ORM saves programmer time! </li></ul>
  4. 4. Important differences <ul><li>Several areas: </li></ul><ul><ul><li>Data Binding </li></ul></ul><ul><ul><li>Business Logic </li></ul></ul><ul><ul><li>Multi-Tier </li></ul></ul>
  5. 5. Data Binding ADO.NET Data Binding DataTables, DataSets – query results ADO.NET ORM Data Binding? Name City Mike Reading Ruth Liverpool Sue London Brad Birmingham Jim Newcastle
  6. 6. Data Binding ORM ADO.NET Fetch data IList IBindingList ITypedList ... ORM Fetch data Name City Mike Reading Ruth Liverpool Sue London Brad Birmingham Jim Newcastle
  7. 7. Business Logic ADO.NET SQL Stored procedures (T-SQL, ...) Trigger code ... ADO.NET, SQL code Functionality Functionality Functionality must be implemented in different models, using different programming languages.
  8. 8. Business Logic ORM SQL Stored procedures (T-SQL, ...) Trigger code ... ORM Functionality on the server implemented in .NET ORM leverages existing knowledge and skills related to OO programming and unifies the programming model ORM can provide a level of abstraction towards the database Functionality Functionality Functionality is implemented in the same model, using the same programming language.
  9. 9. Demo <ul><li>Differences between ADO.NET and ORM based applications – Data Binding and Business Logic </li></ul>
  10. 10. Where does my Business Logic live? <ul><li>Several possibilities: </li></ul><ul><li>In the persistent classes themselves </li></ul><ul><li>In separate classes – separate BL layer </li></ul><ul><li>In the process implementations </li></ul>
  11. 11. When is Business Logic executed? <ul><li>More things to consider: </li></ul><ul><li>Automatically, e.g. when objects are created or saved. </li></ul><ul><li>“ Manually”, i.e. from a process implementation </li></ul>
  12. 12. Important for Business Logic! Expectations regarding data consistency could be different when ORM is being used: suddenly data has to be consistent even if it lives “only” in RAM! Whether or not this is relevant for you depends on your use case.
  13. 13. Important differences <ul><li>Several areas: </li></ul><ul><ul><li>Data Binding </li></ul></ul><ul><ul><li>Business Logic </li></ul></ul><ul><ul><li>Multi-Tier </li></ul></ul>
  14. 14. Multi-Tier with ADO.NET Network – XML WebServices, WCF, ... Serialization Deserialization Result: Identical data! Name City Mike Reading Ruth Liverpool Sue London Brad Birmingham Jim Newcastle Name City Mike Reading Ruth Liverpool Sue London Brad Birmingham Jim Newcastle
  15. 15. Multi-Tier with ORM <ul><li>Objects contain more than just data </li></ul><ul><li>The ORM system does a lot of management work for us, and so it has certain expectations about status. </li></ul><ul><li>Consequence: Communication must be designed to consider ORM requirements </li></ul>
  16. 16. Multi-Tier with ORM Dynamic SQL Network Metadata Transport format Transport format / SQL Persistent Classes / Query classes / Transport format Persistent Classes Layer Data used ORM Optional! Application The application works with persistent classes and calls functionality of the ORM system. On this layer, the ORM system provides most of its services – Identity Map, Transaction handling, ... The transport format defines Data Transfer Objects (DTOs). This layer is optional – it’s used when “Dynamic SQL” is a separate tier. Finally the ORM system dynamically generates SQL code.
  17. 17. Demo <ul><li>Tunnelling through .NET Remoting </li></ul>
  18. 18. Tunnelling is not specific to Remoting <ul><li>.NET Remoting is really easy to use, as it maps all .NET data types directly </li></ul><ul><li>I have examples for tunnelling through XML Web Services, WCF and RemObjects. </li></ul>
  19. 19. Further information <ul><li>My blog: http://www.sturmnet.org/blog </li></ul><ul><li>My email: [email_address] </li></ul><ul><li>Commercial: http://www.devexpress.com/xpo </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×