Top Banner
Object XML Mappings An introduction Joost Diepenmaat [email protected] Friday, February 27, 2009
28

Object XML Mappings

Jan 22, 2018

Download

Technology

guest140888
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Object XML Mappings

Object XML MappingsAn introduction

Joost [email protected]

Friday, February 27, 2009

Page 2: Object XML Mappings

1. Introduction to ORM’s in the SQL world!

2. Object XML Mappings

Friday, February 27, 2009

Page 3: Object XML Mappings

Enterprise Application Layers

Presentation Interaction

Domain Logic

Data Source Storage

Friday, February 27, 2009

Page 4: Object XML Mappings

Enterprise Application Layers

Presentation Interaction

Domain Logic

Data Source Storage

ORM’s live here!

Friday, February 27, 2009

Page 5: Object XML Mappings

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age

Friday, February 27, 2009

Page 6: Object XML Mappings

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age Class Student

firstnamelastnameage

Friday, February 27, 2009

Page 7: Object XML Mappings

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age Class Student

firstnamelastnameage

Friday, February 27, 2009

Page 8: Object XML Mappings

ORM & ActiveRecord

"An object that wraps a row in a database table or view, encapsulates

the database access, and adds domain logic on that data."

- Martin Fowler

Friday, February 27, 2009

Page 9: Object XML Mappings

Very short demo...

Friday, February 27, 2009

Page 10: Object XML Mappings

More ORM!

Friday, February 27, 2009

Page 11: Object XML Mappings

class Student < ActiveRecord::Base has_many :courses belongs_to :universityend

student = Student.find_by_name("Joost")student.courses #returns all courses

Associations

Friday, February 27, 2009

Page 12: Object XML Mappings

class Student < ActiveRecord::Base validates_presence_of :firstname, :lastname validates_uniqueness_of :number validates_acceptance_of :terms_of_service validates_confirmation_of :passwordend

Validations

Friday, February 27, 2009

Page 13: Object XML Mappings

✓Associations

✓Validations

✓Finders

✓Callbacks

✓Observers

✓Inheritance

✓Direct manipulation

✓Transactions

✓Database abstraction

✓etc. etc.

Friday, February 27, 2009

Page 14: Object XML Mappings

• Java: Hibernate

• Ruby: ActiveRecord, DataMapper

• .Net: LINQ

• Python: Django’s ORM

• More, more, more....

ORM’s are popular

Friday, February 27, 2009

Page 15: Object XML Mappings

ORM’s are SQL based.

Friday, February 27, 2009

Page 16: Object XML Mappings

Complex XML standards

• OpenXML

• GIS

• Universal Business Language

• ebXML

• XBRL

• Healthcare XML

• Voice XML

Friday, February 27, 2009

Page 17: Object XML Mappings

ORM’s do not support native XML storage.

Friday, February 27, 2009

Page 18: Object XML Mappings

2. Object Relational XML Mappings

Friday, February 27, 2009

Page 19: Object XML Mappings

Place XML in domain logic

into separate classes.

Friday, February 27, 2009

Page 20: Object XML Mappings

<student> <name>Joost</name> <courses>

<course> <title>XML & DB I</title> <score>7</score> </course> <course> <title>XML & DB II</title> <score>9</score> </course>...

Friday, February 27, 2009

Page 21: Object XML Mappings

<student> <name>Joost</name> <courses>

<course> <title>XML & DB I</title> <score>7</score> </course> <course> <title>XML & DB II</title> <score>9</score> </course>...

Class Student

Friday, February 27, 2009

Page 22: Object XML Mappings

<student> <name>Joost</name> <courses>

<course> <title>XML & DB I</title> <score>7</score> </course> <course> <title>XML & DB II</title> <score>9</score> </course>...

Class Student

Class Course

Friday, February 27, 2009

Page 23: Object XML Mappings

<student> <name>Joost</name> <courses>

<course> <title>XML & DB I</title> <score>7</score> </course> <course> <title>XML & DB II</title> <score>9</score> </course>...

Class Student

Class Course

student = Student.find_by_name("Joost")student.courses

Friday, February 27, 2009

Page 24: Object XML Mappings

Thesis studies:

The possibilities of an OXM with XML/XPath as

a base language for storage.

Friday, February 27, 2009

Page 25: Object XML Mappings

Research Questions

1. How can we extend RoR with XPath Accelerator to create an XML database for efficient XML storage and XPath processing?

2. How can we implement XML based Object Mapping on the XML database created?

3. What kind of XML related functionality can we add to the system?

Friday, February 27, 2009

Page 26: Object XML Mappings

Object

Elements map

Pathfinder core

SQL storage

Student

tag “<student>”

XPath to SQL queries

pre | size | level

layer contains

Friday, February 27, 2009

Page 27: Object XML Mappings

Elements MapUniversity

Pathfinder

SQL

ElementsRegister

ObjectMapping

ElementsMap

XPathQueries Etc.

Student CourseObjects

Friday, February 27, 2009

Page 28: Object XML Mappings

Questions?

Friday, February 27, 2009