Maglev-A different way to develop with Ruby
-
Upload
hernan-wilkinson -
Category
Technology
-
view
768 -
download
0
description
Transcript of Maglev-A different way to develop with Ruby
![Page 1: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/1.jpg)
agile software development & services
MaglevRubyConf Argentina 2012
Hernán WilkinsonTwitter: @HernanWilkinson
Blog: objectmodels.blogspot.comwww.10pines.com
![Page 2: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/2.jpg)
![Page 3: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/3.jpg)
What is the presentation about
![Page 4: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/4.jpg)
Common WebApp Architecture
![Page 5: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/5.jpg)
Common WebApp Architecture
![Page 6: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/6.jpg)
Issues
Code vs. DataObject vs. Data
![Page 7: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/7.jpg)
Issues
Paradigm Mismatch(Need a translator)
![Page 8: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/8.jpg)
Issues
Design Errors
• Forced by the ORM• Thinking in tables not in objects• Difficult to create test objects – Mock
abuse!• etc
![Page 9: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/9.jpg)
Issues
More time to run!
• Tests run slow!• Starting can take minutes due to
ActiveRecord!
![Page 10: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/10.jpg)
Therefore…
More “Human” TimeBigger Development Cost
![Page 11: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/11.jpg)
Imagine…
![Page 12: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/12.jpg)
Imagine…
![Page 13: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/13.jpg)
![Page 14: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/14.jpg)
Maglev
A…– Transactional– Automatically persisted– Multi-VM – NO RAM restricted
… Object Server
![Page 15: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/15.jpg)
Maglev
• Two Modes:– Transient mode (normal ruby)– Persistent mode – The really interesting one!• Objects are naturally persistent• On Commit, saves transitive closure from a root
object• Transactional memory! (no deadlocks)
![Page 16: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/16.jpg)
Example!
• Investment Accounts – Balance:
• 10 pesos + 5 dollars• 3000 bodens2012 + 600 futureDollarJan2013
• Portfolios– Account composite
• Multiple Web Interface– Sinatra (simple )– Rails
• Using TDD!
![Page 17: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/17.jpg)
![Page 18: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/18.jpg)
![Page 19: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/19.jpg)
Goals
1. No Object-To-RDB Mapping– No Portfolio < ActiveRecord– No id
2. No SQL SELECT…3. No save! or update!4. Separation of concern – No transactional code mixed with model code
5. No Model to Web Framework coupling6. Only Objects!7. Development using TDD
![Page 20: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/20.jpg)
Fulfilling Goals…
• No Object-To-RDB Mapping– No Portfolio < ActiveRecord– No id
• No SQL SELECT
![Page 21: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/21.jpg)
Account Hierarchy
![Page 22: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/22.jpg)
AccountTransaction Hierarchy
![Page 23: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/23.jpg)
Measure Hierarchy
![Page 24: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/24.jpg)
Fulfilling Goals…
• No Model to Web Framework coupling
![Page 25: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/25.jpg)
PortfolioSystem and PortfolioSinatraApplication
![Page 26: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/26.jpg)
Fulfilling Goals…
• No save! or update!• Separation of concern – No transactional code mixed with model
code
![Page 27: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/27.jpg)
Showing the home page
![Page 28: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/28.jpg)
Adding an Account
![Page 29: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/29.jpg)
FREEDOM!!!
![Page 30: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/30.jpg)
Conclusions
• Just Objects!• No ORM! No SQL! No ActiveRecord! • Tests run fast• Developed really fast• No need for mocks! – Bye bye FactoryGirl!• We did not have to worry about– Persistence– Transaccionability– Solved in one place
![Page 31: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/31.jpg)
Conclusions
SimplerEasier
Cheaper…
Happier
![Page 32: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/32.jpg)
Maglev
• Install with: rvm install maglev• Ruby 1.8.7• Rails: – No scaffolding when using just objects– Need to write generators
• Heroku??• Licence– Ruby code open source– VM is not open source
![Page 33: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/33.jpg)
Futurology
Relational Databases will fall in less than 10 years
![Page 34: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/34.jpg)
• Diseño Avanzado de Softaware con Objetos I: 29 de Octubre
• Metaprogramación con Lenguajes de Objetos: 13 de Noviembre
• TDD: 19 de Noviembre
• Diseño Avanzado de Softaware con Objetos II: 4 de Diciembre
(50% de descuento si vinieron a esta conferencia!)http://www.10pines.com/content/cursos-disponibles
![Page 35: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/35.jpg)
Smalltalks 2012
![Page 36: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/36.jpg)
Questions?
![Page 37: Maglev-A different way to develop with Ruby](https://reader034.fdocuments.us/reader034/viewer/2022051314/557d4346d8b42af30d8b526c/html5/thumbnails/37.jpg)
agile software development & services
Muchas gracias!
twitter: @10Pines
Argentina
Tel.: +54 (11) 6091-3125Alem 693, 5BBuenos Aires