Your SlideShare is downloading. ×
Object Relational Mapping In Real World Applications
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Object Relational Mapping In Real World Applications

2,099

Published on

Object Relational Mapping in real-world applications with Oliver Sturm

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,099
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
117
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Object/Relational Mapping in real-world applications
  • 2. What is Object/Relational Mapping?
    • 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.
  • 3. Why is ORM being used?
    • 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
    • ORM saves programmer time!
  • 4. Important differences
    • Several areas:
      • Data Binding
      • Business Logic
      • Multi-Tier
  • 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. 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. 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. 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. Demo
    • Differences between ADO.NET and ORM based applications – Data Binding and Business Logic
  • 10. Where does my Business Logic live?
    • Several possibilities:
    • In the persistent classes themselves
    • In separate classes – separate BL layer
    • In the process implementations
  • 11. When is Business Logic executed?
    • More things to consider:
    • Automatically, e.g. when objects are created or saved.
    • “ Manually”, i.e. from a process implementation
  • 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. Important differences
    • Several areas:
      • Data Binding
      • Business Logic
      • Multi-Tier
  • 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. Multi-Tier with ORM
    • Objects contain more than just data
    • The ORM system does a lot of management work for us, and so it has certain expectations about status.
    • Consequence: Communication must be designed to consider ORM requirements
  • 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. Demo
    • Tunnelling through .NET Remoting
  • 18. Tunnelling is not specific to Remoting
    • .NET Remoting is really easy to use, as it maps all .NET data types directly
    • I have examples for tunnelling through XML Web Services, WCF and RemObjects.
  • 19. Further information
    • My blog: http://www.sturmnet.org/blog
    • My email: [email_address]
    • Commercial: http://www.devexpress.com/xpo

×