object xml mappings

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

Upload: guest140888

Post on 22-Jan-2018

709 views

Category:

Technology


0 download

TRANSCRIPT

Object XML MappingsAn introduction

Joost [email protected]

Friday, February 27, 2009

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

2. Object XML Mappings

Friday, February 27, 2009

Enterprise Application Layers

Presentation Interaction

Domain Logic

Data Source Storage

Friday, February 27, 2009

Enterprise Application Layers

Presentation Interaction

Domain Logic

Data Source Storage

ORM’s live here!

Friday, February 27, 2009

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age

Friday, February 27, 2009

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age Class Student

firstnamelastnameage

Friday, February 27, 2009

Object Relational Mapping

Joost Diepenmaat 26

Jan Klaassen 24

John Doe 23

firstname lastname age Class Student

firstnamelastnameage

Friday, February 27, 2009

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

Very short demo...

Friday, February 27, 2009

More ORM!

Friday, February 27, 2009

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

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

✓Associations

✓Validations

✓Finders

✓Callbacks

✓Observers

✓Inheritance

✓Direct manipulation

✓Transactions

✓Database abstraction

✓etc. etc.

Friday, February 27, 2009

• Java: Hibernate

• Ruby: ActiveRecord, DataMapper

• .Net: LINQ

• Python: Django’s ORM

• More, more, more....

ORM’s are popular

Friday, February 27, 2009

ORM’s are SQL based.

Friday, February 27, 2009

Complex XML standards

• OpenXML

• GIS

• Universal Business Language

• ebXML

• XBRL

• Healthcare XML

• Voice XML

Friday, February 27, 2009

ORM’s do not support native XML storage.

Friday, February 27, 2009

2. Object Relational XML Mappings

Friday, February 27, 2009

Place XML in domain logic

into separate classes.

Friday, February 27, 2009

<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

<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

<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

<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

Thesis studies:

The possibilities of an OXM with XML/XPath as

a base language for storage.

Friday, February 27, 2009

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

Object

Elements map

Pathfinder core

SQL storage

Student

tag “<student>”

XPath to SQL queries

pre | size | level

layer contains

Friday, February 27, 2009

Elements MapUniversity

Pathfinder

SQL

ElementsRegister

ObjectMapping

ElementsMap

XPathQueries Etc.

Student CourseObjects

Friday, February 27, 2009

Questions?

Friday, February 27, 2009