Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RubyConf Uruguay 2013 - New York, New York
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Patricio Mac Adden
March 23, 2013
Programming
2
100
RubyConf Uruguay 2013 - New York, New York
Patricio Mac Adden
March 23, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
280
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
CSC307 Lecture 02
javiergs
PRO
1
780
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
110
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
630
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
470
CSC307 Lecture 03
javiergs
PRO
1
490
CSC307 Lecture 10
javiergs
PRO
1
660
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.7k
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
330
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
Context Engineering - Making Every Token Count
addyosmani
9
670
Un-Boring Meetings
codingconduct
0
200
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
65
We Are The Robots
honzajavorek
0
170
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
340
Mind Mapping
helmedeiros
PRO
0
90
Chasing Engaging Ingredients in Design
codingconduct
0
110
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
Transcript
New York, New York
Patricio Mac Adden
[email protected]
maxawen
None
Esta charla es sobre Sinatra...
... y sobre buenas prácticas
“Is a DSL for quickly creating web-applications in Ruby.” -
Documentación oficial - Sinatra
Sinatra: routes
Sinatra: views
Sinatra: views
Sinatra: static files
Sinatra: static files
Sinatra: static files
Sinatra: filters
Sinatra: helpers
Sinatra: helpers
Sinatra: configuration
Sinatra: environments
Sinatra: error handling
Sinatra: classic
Sinatra: modular
Sinatra: rides on Rack
Pero...
“It isn’t a typical Model-View-Controller framework, but ties specific URL
directly to relevant Ruby code and returns its output in response. It does enable you, however, to write clean, properly organized applications: separating views from application code, for instance.” - Documentación oficial - Sinatra
Sin estructura de directorios por defecto
Sin ORM por defecto
Sin base de datos por defecto
Sin tasks
Sin test framework por defecto
¡No decide nada por nosotros!
Sinatra es ideal para prototipos, APIs y aplicaciones pequeñas
Pero también para aplicaciones grandes, ¿por qué no?
El problema
Sinatra es flexible
Desorden
¿Como organizar los controllers?
Uso inconsistente del DSL
Rutas no RESTful
Inline templates
Inline templates y templates estándar
etc.
La solución
La solución (no existe una única solución) Mi
Buenas Prácticas
* Definir una estructura de directorios
* ¿Cómo vamos a manejar los controllers?
* ORM (¿Necesitamos ORM?)
* Elegir una base de datos
* Elegir un Test framework
¿Classic o Modular?
* Configuración por defecto
* Configurar los diferentes entornos
* Elegir un template engine
== Application Template
Pero esto todavía no es un framework
* Tasks
* Autoload
Recordar:
Sinatra es flexible
Rack
Seamos inteligentes y usemos esto en nuestro favor
¿Preguntas?
¡Gracias!