SlideShare una empresa de Scribd logo
1 de 35
Descargar para leer sin conexión
Voyage by example 
tips and tricks on persisting object models
Esteban Lorenzano 
Pharo core developer 
INRIA - RMoD 
http://smallworks.eu
Why? 
• You already know about Voyage 
• You already attended to a tutorial last year 
• But there are some recurrent problems people find 
when trying to use it 
• And I’m still seeing a lot of people that could be 
using it and they chose other solutions
What is Voyage? (1) 
• Simple abstraction layer to map objects into a database 
- Very well suited for document databases, but in theory, 
the approach will work for other kind of repositories 
‣ There was (long time ago) a Voyage-GLORP backend 
‣ There was (even more time ago) a Voyage- 
ImageSegment backend 
- Voyage-Memory, Voyage-Mongo
What is Voyage? (2) 
• Did I said is simple? 
• it ensures object identity 
• it provides error handling 
• it implements a connection pool
Voyage principles 
• Behavioural complete (for common usage), but 
decoupled approach also possible. 
• Same design for different backends, but not a 
common abstraction 
- There is no such thing as a “voyage query 
language”, etc. 
- is a bit more work for users who want to switch, 
but a lot more happiness for the program itself
Voyage ultimate goal 
To be the GLORP for NoSQL databases
The problem to solve
Impedance mistmatch 
Class A Class B Class C 
Table A Table B Table C 
1..* 
*..* 
Ideal relational model
Impedance mistmatch 
aColection 
anObject otherObject 
firstObject 
secondObject 
thirdObject 
Real object model
Impedance mistmatch 
aColection 
anObject otherObject 
Real object model 
firstObject 
secondObject 
thirdObject
Impedance mistmatch 
aColection 
anObject otherObject 
Real object model 
firstObject 
secondObject 
thirdObject
So, what about those tips?
Think in objects
A simple model 
*..* 
Hero Power
Persist 
(Hero named: ‘Groot’) 
addPower: ((Power named: ‘Plant Control’) 
level: #epic; 
yourself); 
save.
Persist 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Groot’, 
powers: [ { #collection: ‘Power’, __id: OID(…) } ] 
} 
! 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Power’, 
name: ‘Plant Control’, 
level: #epic, 
heroes: [ #collection: ‘Hero’, __id: OID(…) ] 
}
Take control
A simple model 
(a bit more complete) 
*..* 
Hero Power 
1..* 
Equipment 
Container Pistol 
1..*
Persist 
(Hero named: ‘Star-lord’) 
addEquipment: (Container 
addItem: Pistol new; 
yourself); 
save.
Persist (1) 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Persist (2) 
{ 
_id: OID(1), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { #collection: ‘Equipment’, __id: OID(2) } ] 
} 
! 
{ 
_id: OID(2), 
#version: …, 
#instanceOf: ‘Container’, 
items: [ { #collection: ‘Equipment’, __id: OID(3) } ] 
} 
! 
{ 
_id: OID(3), 
#version: …, 
#instanceOf: ‘Pistol’, 
}
Integrity is a 
consequence
Allowing missing content 
• We do not have foreign keys 
- So we cannot do things like “ON DELETE 
CASCADE” 
- Even delete validations are difficult 
‣ Imagine “hero” has a “power”,and I remove the 
“power”. How can the hero notice it?
Persist 
mongoContainer 
<mongoContainer> 
! 
^ VOMongoContainer new 
collectionName: ‘powers’; 
enableMissingContent; 
yourself
Querying smart
Query (1) 
Hero 
selectMany: [ :each | … ] 
sortBy: { #name -> VOOrder ascending } asDictionary 
limit: 100 
offset: 100
Query (2) 
Hero 
selectMany: { 
‘name’ -> { 
‘$regexp’ -> ‘^G.*’. 
‘$options’ -> ‘i’ 
} asDictionary 
} asDictionary
Adapt schemes
The “scheme is not mine” 
problem 
• You can move meta-information to your program 
• Magritte-Voyage gives you a lot of power 
• You can extend/modify parts of the updating 
system too (like versioning)
Meta-information 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Meta-information 
{ 
_id: OID(…), 
#version: …, 
#instanceOf: ‘Hero’, 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
#instanceOf: ‘Container’, 
‘items’, [ 
{ #instanceOf: ‘Pistol’ } ] } ] 
}
Meta-information 
{ 
_id: OID(…), 
name: ‘Star-lord’, 
powers: [], 
equipment: [ { 
‘items’, [ {} ] } ] 
}
Voyage 2.0 
• Root detection (enhance save & update) 
• Cyclic detection 
- Add strategy to persist cycles even without roots (It has some 
consequences (in querying, etc.), so it will be optional) 
• integrity validations 
- #removeWithDependencies 
• Materialisation customisations 
- #readRaw 
• Add backend: Riak
Use it today! 
Gofer it 
smalltalkhubUser: ‘Pharo’ project: ’MetaRepoForPharo30’; 
configurationOf: ‘VoyageMongo’; 
loadStable. 
Thanks!! 
Esteban Lorenzano - 2014

Más contenido relacionado

La actualidad más candente

Designers Guide To jQuery
Designers Guide To jQueryDesigners Guide To jQuery
Designers Guide To jQuerySteve Krueger
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with MooseDave Cross
 
Multitenant applications: How and Why
Multitenant applications: How and WhyMultitenant applications: How and Why
Multitenant applications: How and WhyFilipe Ximenes
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2techvoltz
 
Serializing Ruby Objects in Redis
Serializing Ruby Objects in RedisSerializing Ruby Objects in Redis
Serializing Ruby Objects in RedisBrian Kaney
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"Tomas Doran
 
Advanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAdvanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAijaz Ansari
 
Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011John Stevenson
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Tim Plummer
 
Using Data That Isn't Yours
Using Data That Isn't YoursUsing Data That Isn't Yours
Using Data That Isn't Yourscogsprocket
 
Introduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsIntroduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsSimon Bagreev
 

La actualidad más candente (19)

Redis and Ohm
Redis and OhmRedis and Ohm
Redis and Ohm
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Smalltalk on rubinius
Smalltalk on rubiniusSmalltalk on rubinius
Smalltalk on rubinius
 
Designers Guide To jQuery
Designers Guide To jQueryDesigners Guide To jQuery
Designers Guide To jQuery
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with Moose
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Multitenant applications: How and Why
Multitenant applications: How and WhyMultitenant applications: How and Why
Multitenant applications: How and Why
 
Your JavaScript Library
Your JavaScript LibraryYour JavaScript Library
Your JavaScript Library
 
Creatively creating custom post types! word sesh2
Creatively creating custom post types!  word sesh2Creatively creating custom post types!  word sesh2
Creatively creating custom post types! word sesh2
 
Serializing Ruby Objects in Redis
Serializing Ruby Objects in RedisSerializing Ruby Objects in Redis
Serializing Ruby Objects in Redis
 
Sprockets
SprocketsSprockets
Sprockets
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
 
Essential YUI
Essential YUIEssential YUI
Essential YUI
 
Advanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDBAdvanced Debugging with Xcode - Extending LLDB
Advanced Debugging with Xcode - Extending LLDB
 
Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011Getting startedwith noir-clojureexchange-2011
Getting startedwith noir-clojureexchange-2011
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
 
Using Data That Isn't Yours
Using Data That Isn't YoursUsing Data That Isn't Yours
Using Data That Isn't Yours
 
Introduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsIntroduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on Rails
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 

Similar a Voyage by example

Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandAngela Byron
 
Questioning the status quo
Questioning the status quoQuestioning the status quo
Questioning the status quoIvano Pagano
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?ColdFusionConference
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?devObjective
 
Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insAndrew Dupont
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design PatternsAddy Osmani
 
【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践taobao.com
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryWingify Engineering
 

Similar a Voyage by example (20)

Voyage by example
Voyage by exampleVoyage by example
Voyage by example
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
 
Dependency injectionpreso
Dependency injectionpresoDependency injectionpreso
Dependency injectionpreso
 
Week3
Week3Week3
Week3
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Drupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the islandDrupal 8: A story of growing up and getting off the island
Drupal 8: A story of growing up and getting off the island
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Questioning the status quo
Questioning the status quoQuestioning the status quo
Questioning the status quo
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Design patterns
Design patternsDesign patterns
Design patterns
 
About Python
About PythonAbout Python
About Python
 
Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-ins
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
обзор Python
обзор Pythonобзор Python
обзор Python
 
Jvm internals
Jvm internalsJvm internals
Jvm internals
 
【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践【前端Mvc】之豆瓣说实践
【前端Mvc】之豆瓣说实践
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQuery
 

Más de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Más de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Último

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Último (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Voyage by example

  • 1. Voyage by example tips and tricks on persisting object models
  • 2. Esteban Lorenzano Pharo core developer INRIA - RMoD http://smallworks.eu
  • 3. Why? • You already know about Voyage • You already attended to a tutorial last year • But there are some recurrent problems people find when trying to use it • And I’m still seeing a lot of people that could be using it and they chose other solutions
  • 4. What is Voyage? (1) • Simple abstraction layer to map objects into a database - Very well suited for document databases, but in theory, the approach will work for other kind of repositories ‣ There was (long time ago) a Voyage-GLORP backend ‣ There was (even more time ago) a Voyage- ImageSegment backend - Voyage-Memory, Voyage-Mongo
  • 5. What is Voyage? (2) • Did I said is simple? • it ensures object identity • it provides error handling • it implements a connection pool
  • 6. Voyage principles • Behavioural complete (for common usage), but decoupled approach also possible. • Same design for different backends, but not a common abstraction - There is no such thing as a “voyage query language”, etc. - is a bit more work for users who want to switch, but a lot more happiness for the program itself
  • 7. Voyage ultimate goal To be the GLORP for NoSQL databases
  • 9. Impedance mistmatch Class A Class B Class C Table A Table B Table C 1..* *..* Ideal relational model
  • 10. Impedance mistmatch aColection anObject otherObject firstObject secondObject thirdObject Real object model
  • 11. Impedance mistmatch aColection anObject otherObject Real object model firstObject secondObject thirdObject
  • 12. Impedance mistmatch aColection anObject otherObject Real object model firstObject secondObject thirdObject
  • 13. So, what about those tips?
  • 15. A simple model *..* Hero Power
  • 16. Persist (Hero named: ‘Groot’) addPower: ((Power named: ‘Plant Control’) level: #epic; yourself); save.
  • 17. Persist { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Groot’, powers: [ { #collection: ‘Power’, __id: OID(…) } ] } ! { _id: OID(…), #version: …, #instanceOf: ‘Power’, name: ‘Plant Control’, level: #epic, heroes: [ #collection: ‘Hero’, __id: OID(…) ] }
  • 19. A simple model (a bit more complete) *..* Hero Power 1..* Equipment Container Pistol 1..*
  • 20. Persist (Hero named: ‘Star-lord’) addEquipment: (Container addItem: Pistol new; yourself); save.
  • 21. Persist (1) { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 22. Persist (2) { _id: OID(1), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #collection: ‘Equipment’, __id: OID(2) } ] } ! { _id: OID(2), #version: …, #instanceOf: ‘Container’, items: [ { #collection: ‘Equipment’, __id: OID(3) } ] } ! { _id: OID(3), #version: …, #instanceOf: ‘Pistol’, }
  • 23. Integrity is a consequence
  • 24. Allowing missing content • We do not have foreign keys - So we cannot do things like “ON DELETE CASCADE” - Even delete validations are difficult ‣ Imagine “hero” has a “power”,and I remove the “power”. How can the hero notice it?
  • 25. Persist mongoContainer <mongoContainer> ! ^ VOMongoContainer new collectionName: ‘powers’; enableMissingContent; yourself
  • 27. Query (1) Hero selectMany: [ :each | … ] sortBy: { #name -> VOOrder ascending } asDictionary limit: 100 offset: 100
  • 28. Query (2) Hero selectMany: { ‘name’ -> { ‘$regexp’ -> ‘^G.*’. ‘$options’ -> ‘i’ } asDictionary } asDictionary
  • 30. The “scheme is not mine” problem • You can move meta-information to your program • Magritte-Voyage gives you a lot of power • You can extend/modify parts of the updating system too (like versioning)
  • 31. Meta-information { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 32. Meta-information { _id: OID(…), #version: …, #instanceOf: ‘Hero’, name: ‘Star-lord’, powers: [], equipment: [ { #instanceOf: ‘Container’, ‘items’, [ { #instanceOf: ‘Pistol’ } ] } ] }
  • 33. Meta-information { _id: OID(…), name: ‘Star-lord’, powers: [], equipment: [ { ‘items’, [ {} ] } ] }
  • 34. Voyage 2.0 • Root detection (enhance save & update) • Cyclic detection - Add strategy to persist cycles even without roots (It has some consequences (in querying, etc.), so it will be optional) • integrity validations - #removeWithDependencies • Materialisation customisations - #readRaw • Add backend: Riak
  • 35. Use it today! Gofer it smalltalkhubUser: ‘Pharo’ project: ’MetaRepoForPharo30’; configurationOf: ‘VoyageMongo’; loadStable. Thanks!! Esteban Lorenzano - 2014